@wirekyt/dom 0.0.1 → 0.0.2
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.
- package/dist/anatomy-DMuSMbOP.d.cts +18 -0
- package/dist/anatomy-DMuSMbOP.d.ts +18 -0
- package/dist/anatomy.cjs +3 -0
- package/dist/anatomy.d.cts +2 -0
- package/dist/anatomy.d.ts +2 -0
- package/dist/anatomy.js +2 -0
- package/dist/angle-3hqP0Mp5.cjs +13 -0
- package/dist/angle-oNt8uGHQ.js +8 -0
- package/dist/aria-hidden-CEXexb2I.js +127 -0
- package/dist/aria-hidden-Y7iJHPMr.cjs +132 -0
- package/dist/aria-hidden.cjs +3 -0
- package/dist/aria-hidden.d.cts +10 -0
- package/dist/aria-hidden.d.ts +10 -0
- package/dist/aria-hidden.js +2 -0
- package/dist/array-BGtygd0o.cjs +198 -0
- package/dist/array-C4KbHsha.js +73 -0
- package/dist/auto-resize-5F5iiKZb.cjs +106 -0
- package/dist/auto-resize-KkNfCcBt.js +95 -0
- package/dist/auto-resize.cjs +4 -0
- package/dist/auto-resize.d.cts +7 -0
- package/dist/auto-resize.d.ts +7 -0
- package/dist/auto-resize.js +2 -0
- package/dist/caret-CHqaP4XG.cjs +30 -0
- package/dist/caret-aiDJ6mAS.js +19 -0
- package/dist/closest-Clo6ODcK.js +117 -0
- package/dist/closest-IiRz1GIJ.cjs +176 -0
- package/dist/collection-CJU0oDtX.js +1295 -0
- package/dist/collection-CwzUJwBJ.cjs +1342 -0
- package/dist/collection.cjs +15 -0
- package/dist/collection.d.cts +34 -0
- package/dist/collection.d.ts +34 -0
- package/dist/collection.js +3 -0
- package/dist/color-CsugZjq6.d.cts +60 -0
- package/dist/color-CsugZjq6.d.ts +60 -0
- package/dist/color-utils-DzeOVYlL.cjs +662 -0
- package/dist/color-utils-lDDg9FEh.js +639 -0
- package/dist/color-utils.cjs +6 -0
- package/dist/color-utils.d.cts +18 -0
- package/dist/color-utils.d.ts +18 -0
- package/dist/color-utils.js +2 -0
- package/dist/computed-style-B1MKlCoo.js +9 -0
- package/dist/computed-style-DLArEFNw.cjs +14 -0
- package/dist/controller-B8E8ZJCI.cjs +133 -0
- package/dist/controller-Dv7lWHDr.js +92 -0
- package/dist/core-BF6G2RiC.d.cts +1 -0
- package/dist/core-BNMw-JId.cjs +372 -0
- package/dist/core-BdeZuSX6.d.ts +1 -0
- package/dist/core-CJ0MZr3D.js +289 -0
- package/dist/core.cjs +19 -0
- package/dist/core.d.cts +3 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.js +3 -0
- package/dist/create-anatomy-B2q3wiaw.js +22 -0
- package/dist/create-anatomy-BwDn25ph.cjs +27 -0
- package/dist/create-props-CgtcN_Qu.js +4 -0
- package/dist/create-props-CjLx2oS8.cjs +9 -0
- package/dist/data-url-C-Uk31Q9.cjs +42 -0
- package/dist/data-url-DHUHj7UF.js +37 -0
- package/dist/data-url-Gx_SWG-k.d.cts +10 -0
- package/dist/data-url-Gx_SWG-k.d.ts +10 -0
- package/dist/date-utils-D-JJHedx.cjs +868 -0
- package/dist/date-utils-D5zXW-Cs.js +569 -0
- package/dist/date-utils.cjs +52 -0
- package/dist/date-utils.d.cts +7 -0
- package/dist/date-utils.d.ts +7 -0
- package/dist/date-utils.js +2 -0
- package/dist/dismissable-C0bixtzl.cjs +348 -0
- package/dist/dismissable-KM1jPtNQ.js +337 -0
- package/dist/dismissable-layer-BTX5EvXw.d.ts +40 -0
- package/dist/dismissable-layer-Ch5niVaq.d.cts +40 -0
- package/dist/dismissable.cjs +4 -0
- package/dist/dismissable.d.cts +3 -0
- package/dist/dismissable.d.ts +3 -0
- package/dist/dismissable.js +2 -0
- package/dist/dom-query-CQzY93XU.cjs +488 -0
- package/dist/dom-query-e7fh0TEH.js +243 -0
- package/dist/dom-query.cjs +180 -0
- package/dist/dom-query.d.cts +142 -0
- package/dist/dom-query.d.ts +142 -0
- package/dist/dom-query.js +43 -0
- package/dist/equal-C927y7MN.cjs +30 -0
- package/dist/equal-DtrP8DPh.js +25 -0
- package/dist/event-DDz-mMhM.cjs +242 -0
- package/dist/event-bTItRgiw.js +117 -0
- package/dist/file-utils-6EXCdfHx.js +116 -0
- package/dist/file-utils-B7OJigQq.cjs +151 -0
- package/dist/file-utils.cjs +92 -0
- package/dist/file-utils.d.cts +40 -0
- package/dist/file-utils.d.ts +40 -0
- package/dist/file-utils.js +82 -0
- package/dist/focus-trap-89E5I9nm.js +487 -0
- package/dist/focus-trap-D7jKsfHW.cjs +498 -0
- package/dist/focus-trap.cjs +4 -0
- package/dist/focus-trap.d.cts +89 -0
- package/dist/focus-trap.d.ts +89 -0
- package/dist/focus-trap.js +2 -0
- package/dist/focus-visible-DWdQf__4.js +176 -0
- package/dist/focus-visible-G4cmlWqq.cjs +217 -0
- package/dist/focus-visible.cjs +9 -0
- package/dist/focus-visible.d.cts +32 -0
- package/dist/focus-visible.d.ts +32 -0
- package/dist/focus-visible.js +2 -0
- package/dist/form-B1DW_w_3.js +89 -0
- package/dist/form-CoupKpuP.cjs +130 -0
- package/dist/from-window-5ZhzSURC.js +68 -0
- package/dist/from-window-B9DKtaoR.cjs +115 -0
- package/dist/functions-isw5Ovcx.d.cts +16 -0
- package/dist/functions-isw5Ovcx.d.ts +16 -0
- package/dist/highlight-word.cjs +95 -0
- package/dist/highlight-word.d.cts +24 -0
- package/dist/highlight-word.d.ts +24 -0
- package/dist/highlight-word.js +94 -0
- package/dist/hotkeys.cjs +1183 -0
- package/dist/hotkeys.d.cts +199 -0
- package/dist/hotkeys.d.ts +199 -0
- package/dist/hotkeys.js +1173 -0
- package/dist/i18n-utils-BD4VtonY.cjs +345 -0
- package/dist/i18n-utils-C4FQZ39m.js +280 -0
- package/dist/i18n-utils.cjs +216 -0
- package/dist/i18n-utils.d.cts +71 -0
- package/dist/i18n-utils.d.ts +71 -0
- package/dist/i18n-utils.js +204 -0
- package/dist/index-3tNJficI.d.cts +117 -0
- package/dist/index-3tNJficI.d.ts +117 -0
- package/dist/index-BEfvdGE2.d.cts +116 -0
- package/dist/index-BEfvdGE2.d.ts +116 -0
- package/dist/index-BF6G2RiC.d.cts +1 -0
- package/dist/index-BKgxIVbE.d.cts +285 -0
- package/dist/index-BMtpmaRD.d.cts +16 -0
- package/dist/index-BMtpmaRD.d.ts +16 -0
- package/dist/index-BWiYePx8.d.cts +216 -0
- package/dist/index-BXfunVyD.d.cts +1342 -0
- package/dist/index-BXfunVyD.d.ts +1342 -0
- package/dist/index-BdeZuSX6.d.ts +1 -0
- package/dist/index-C2865AJq.d.cts +25 -0
- package/dist/index-C2865AJq.d.ts +25 -0
- package/dist/index-CFoN0L3C.d.ts +285 -0
- package/dist/index-vPrqYDHu.d.ts +216 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/initial-focus-BQxRRFPa.cjs +37 -0
- package/dist/initial-focus-BrN5tT2X.js +26 -0
- package/dist/interact-outside-BjqIunFx.js +211 -0
- package/dist/interact-outside-Dphjr2Zh.cjs +216 -0
- package/dist/interact-outside.cjs +3 -0
- package/dist/interact-outside.d.cts +2 -0
- package/dist/interact-outside.d.ts +2 -0
- package/dist/interact-outside.js +2 -0
- package/dist/json-tree-utils.cjs +1518 -0
- package/dist/json-tree-utils.d.cts +117 -0
- package/dist/json-tree-utils.d.ts +117 -0
- package/dist/json-tree-utils.js +1469 -0
- package/dist/list-collection-D_eNKrot.d.cts +60 -0
- package/dist/list-collection-RqYEWHb4.d.ts +60 -0
- package/dist/live-region-BD0OgmrH.cjs +68 -0
- package/dist/live-region-F8YMmbrY.js +63 -0
- package/dist/live-region.cjs +3 -0
- package/dist/live-region.d.cts +2 -0
- package/dist/live-region.d.ts +2 -0
- package/dist/live-region.js +2 -0
- package/dist/machines/accordion/index.cjs +328 -0
- package/dist/machines/accordion/index.d.cts +83 -0
- package/dist/machines/accordion/index.d.ts +83 -0
- package/dist/machines/accordion/index.js +321 -0
- package/dist/machines/angle-slider/index.cjs +420 -0
- package/dist/machines/angle-slider/index.d.cts +84 -0
- package/dist/machines/angle-slider/index.d.ts +84 -0
- package/dist/machines/angle-slider/index.js +415 -0
- package/dist/machines/async-list/index.cjs +310 -0
- package/dist/machines/async-list/index.d.cts +90 -0
- package/dist/machines/async-list/index.d.ts +90 -0
- package/dist/machines/async-list/index.js +308 -0
- package/dist/machines/avatar/index.cjs +165 -0
- package/dist/machines/avatar/index.d.cts +63 -0
- package/dist/machines/avatar/index.d.ts +63 -0
- package/dist/machines/avatar/index.js +160 -0
- package/dist/machines/carousel/index.cjs +929 -0
- package/dist/machines/carousel/index.d.cts +146 -0
- package/dist/machines/carousel/index.d.ts +146 -0
- package/dist/machines/carousel/index.js +920 -0
- package/dist/machines/cascade-select/index.cjs +1426 -0
- package/dist/machines/cascade-select/index.d.cts +167 -0
- package/dist/machines/cascade-select/index.d.ts +167 -0
- package/dist/machines/cascade-select/index.js +1419 -0
- package/dist/machines/checkbox/index.cjs +316 -0
- package/dist/machines/checkbox/index.d.cts +81 -0
- package/dist/machines/checkbox/index.d.ts +81 -0
- package/dist/machines/checkbox/index.js +311 -0
- package/dist/machines/clipboard/index.cjs +228 -0
- package/dist/machines/clipboard/index.d.cts +72 -0
- package/dist/machines/clipboard/index.d.ts +72 -0
- package/dist/machines/clipboard/index.js +221 -0
- package/dist/machines/collapsible/index.cjs +363 -0
- package/dist/machines/collapsible/index.d.cts +82 -0
- package/dist/machines/collapsible/index.d.ts +82 -0
- package/dist/machines/collapsible/index.js +358 -0
- package/dist/machines/color-picker/index.cjs +1534 -0
- package/dist/machines/color-picker/index.d.cts +207 -0
- package/dist/machines/color-picker/index.d.ts +207 -0
- package/dist/machines/color-picker/index.js +1518 -0
- package/dist/machines/combobox/index.cjs +1554 -0
- package/dist/machines/combobox/index.d.cts +219 -0
- package/dist/machines/combobox/index.d.ts +219 -0
- package/dist/machines/combobox/index.js +1542 -0
- package/dist/machines/date-input/index.cjs +1974 -0
- package/dist/machines/date-input/index.d.cts +230 -0
- package/dist/machines/date-input/index.d.ts +230 -0
- package/dist/machines/date-input/index.js +1958 -0
- package/dist/machines/date-picker/index.cjs +2424 -0
- package/dist/machines/date-picker/index.d.cts +378 -0
- package/dist/machines/date-picker/index.d.ts +378 -0
- package/dist/machines/date-picker/index.js +2408 -0
- package/dist/machines/dialog/index.cjs +378 -0
- package/dist/machines/dialog/index.d.cts +94 -0
- package/dist/machines/dialog/index.d.ts +94 -0
- package/dist/machines/dialog/index.js +373 -0
- package/dist/machines/drawer/index.cjs +2066 -0
- package/dist/machines/drawer/index.d.cts +334 -0
- package/dist/machines/drawer/index.d.ts +334 -0
- package/dist/machines/drawer/index.js +2059 -0
- package/dist/machines/editable/index.cjs +550 -0
- package/dist/machines/editable/index.d.cts +114 -0
- package/dist/machines/editable/index.d.ts +114 -0
- package/dist/machines/editable/index.js +545 -0
- package/dist/machines/file-upload/index.cjs +648 -0
- package/dist/machines/file-upload/index.d.cts +150 -0
- package/dist/machines/file-upload/index.d.ts +150 -0
- package/dist/machines/file-upload/index.js +641 -0
- package/dist/machines/floating-panel/index.cjs +1020 -0
- package/dist/machines/floating-panel/index.d.cts +149 -0
- package/dist/machines/floating-panel/index.d.ts +149 -0
- package/dist/machines/floating-panel/index.js +1012 -0
- package/dist/machines/hover-card/index.cjs +441 -0
- package/dist/machines/hover-card/index.d.cts +82 -0
- package/dist/machines/hover-card/index.d.ts +82 -0
- package/dist/machines/hover-card/index.js +436 -0
- package/dist/machines/image-cropper/index.cjs +2082 -0
- package/dist/machines/image-cropper/index.d.cts +182 -0
- package/dist/machines/image-cropper/index.d.ts +182 -0
- package/dist/machines/image-cropper/index.js +2076 -0
- package/dist/machines/listbox/index.cjs +873 -0
- package/dist/machines/listbox/index.d.cts +175 -0
- package/dist/machines/listbox/index.d.ts +175 -0
- package/dist/machines/listbox/index.js +860 -0
- package/dist/machines/marquee/index.cjs +387 -0
- package/dist/machines/marquee/index.d.cts +102 -0
- package/dist/machines/marquee/index.d.ts +102 -0
- package/dist/machines/marquee/index.js +382 -0
- package/dist/machines/menu/index.cjs +1562 -0
- package/dist/machines/menu/index.d.cts +188 -0
- package/dist/machines/menu/index.d.ts +188 -0
- package/dist/machines/menu/index.js +1549 -0
- package/dist/machines/navigation-menu/index.cjs +860 -0
- package/dist/machines/navigation-menu/index.d.cts +131 -0
- package/dist/machines/navigation-menu/index.d.ts +131 -0
- package/dist/machines/navigation-menu/index.js +855 -0
- package/dist/machines/number-input/index.cjs +1014 -0
- package/dist/machines/number-input/index.d.cts +136 -0
- package/dist/machines/number-input/index.d.ts +136 -0
- package/dist/machines/number-input/index.js +1009 -0
- package/dist/machines/pagination/index.cjs +413 -0
- package/dist/machines/pagination/index.d.cts +139 -0
- package/dist/machines/pagination/index.d.ts +139 -0
- package/dist/machines/pagination/index.js +404 -0
- package/dist/machines/password-input/index.cjs +224 -0
- package/dist/machines/password-input/index.d.cts +71 -0
- package/dist/machines/password-input/index.d.ts +71 -0
- package/dist/machines/password-input/index.js +219 -0
- package/dist/machines/pin-input/index.cjs +595 -0
- package/dist/machines/pin-input/index.d.cts +107 -0
- package/dist/machines/pin-input/index.d.ts +107 -0
- package/dist/machines/pin-input/index.js +590 -0
- package/dist/machines/popover/index.cjs +516 -0
- package/dist/machines/popover/index.d.cts +107 -0
- package/dist/machines/popover/index.d.ts +107 -0
- package/dist/machines/popover/index.js +511 -0
- package/dist/machines/presence/index.cjs +193 -0
- package/dist/machines/presence/index.d.cts +44 -0
- package/dist/machines/presence/index.d.ts +44 -0
- package/dist/machines/presence/index.js +190 -0
- package/dist/machines/progress/index.cjs +282 -0
- package/dist/machines/progress/index.d.cts +96 -0
- package/dist/machines/progress/index.d.ts +96 -0
- package/dist/machines/progress/index.js +277 -0
- package/dist/machines/qr-code/index.cjs +167 -0
- package/dist/machines/qr-code/index.d.cts +71 -0
- package/dist/machines/qr-code/index.d.ts +71 -0
- package/dist/machines/qr-code/index.js +162 -0
- package/dist/machines/radio-group/index.cjs +465 -0
- package/dist/machines/radio-group/index.d.cts +218 -0
- package/dist/machines/radio-group/index.d.ts +218 -0
- package/dist/machines/radio-group/index.js +458 -0
- package/dist/machines/rating-group/index.cjs +405 -0
- package/dist/machines/rating-group/index.d.cts +101 -0
- package/dist/machines/rating-group/index.d.ts +101 -0
- package/dist/machines/rating-group/index.js +398 -0
- package/dist/machines/scroll-area/index.cjs +865 -0
- package/dist/machines/scroll-area/index.d.cts +126 -0
- package/dist/machines/scroll-area/index.d.ts +126 -0
- package/dist/machines/scroll-area/index.js +860 -0
- package/dist/machines/select/index.cjs +1226 -0
- package/dist/machines/select/index.d.cts +190 -0
- package/dist/machines/select/index.d.ts +190 -0
- package/dist/machines/select/index.js +1214 -0
- package/dist/machines/signature-pad/index.cjs +337 -0
- package/dist/machines/signature-pad/index.d.cts +108 -0
- package/dist/machines/signature-pad/index.d.ts +108 -0
- package/dist/machines/signature-pad/index.js +330 -0
- package/dist/machines/slider/index.cjs +1103 -0
- package/dist/machines/slider/index.d.cts +154 -0
- package/dist/machines/slider/index.d.ts +154 -0
- package/dist/machines/slider/index.js +1094 -0
- package/dist/machines/splitter/index.cjs +1686 -0
- package/dist/machines/splitter/index.d.cts +282 -0
- package/dist/machines/splitter/index.d.ts +282 -0
- package/dist/machines/splitter/index.js +1675 -0
- package/dist/machines/steps/index.cjs +330 -0
- package/dist/machines/steps/index.d.cts +109 -0
- package/dist/machines/steps/index.d.ts +109 -0
- package/dist/machines/steps/index.js +325 -0
- package/dist/machines/switch/index.cjs +307 -0
- package/dist/machines/switch/index.d.cts +80 -0
- package/dist/machines/switch/index.d.ts +80 -0
- package/dist/machines/switch/index.js +302 -0
- package/dist/machines/tabs/index.cjs +542 -0
- package/dist/machines/tabs/index.d.cts +113 -0
- package/dist/machines/tabs/index.d.ts +113 -0
- package/dist/machines/tabs/index.js +533 -0
- package/dist/machines/tags-input/index.cjs +1151 -0
- package/dist/machines/tags-input/index.d.cts +182 -0
- package/dist/machines/tags-input/index.d.ts +182 -0
- package/dist/machines/tags-input/index.js +1144 -0
- package/dist/machines/timer/index.cjs +329 -0
- package/dist/machines/timer/index.d.cts +102 -0
- package/dist/machines/timer/index.d.ts +102 -0
- package/dist/machines/timer/index.js +323 -0
- package/dist/machines/toast/index.cjs +1185 -0
- package/dist/machines/toast/index.d.cts +204 -0
- package/dist/machines/toast/index.d.ts +204 -0
- package/dist/machines/toast/index.js +1180 -0
- package/dist/machines/toc/index.cjs +358 -0
- package/dist/machines/toc/index.d.cts +98 -0
- package/dist/machines/toc/index.d.ts +98 -0
- package/dist/machines/toc/index.js +351 -0
- package/dist/machines/toggle/index.cjs +99 -0
- package/dist/machines/toggle/index.d.cts +46 -0
- package/dist/machines/toggle/index.d.ts +46 -0
- package/dist/machines/toggle/index.js +94 -0
- package/dist/machines/toggle-group/index.cjs +329 -0
- package/dist/machines/toggle-group/index.d.cts +81 -0
- package/dist/machines/toggle-group/index.d.ts +81 -0
- package/dist/machines/toggle-group/index.js +322 -0
- package/dist/machines/tooltip/index.cjs +638 -0
- package/dist/machines/tooltip/index.d.cts +84 -0
- package/dist/machines/tooltip/index.d.ts +84 -0
- package/dist/machines/tooltip/index.js +633 -0
- package/dist/machines/tour/index.cjs +1123 -0
- package/dist/machines/tour/index.d.cts +207 -0
- package/dist/machines/tour/index.d.ts +207 -0
- package/dist/machines/tour/index.js +1115 -0
- package/dist/machines/tree-view/index.cjs +1288 -0
- package/dist/machines/tree-view/index.d.cts +221 -0
- package/dist/machines/tree-view/index.d.ts +221 -0
- package/dist/machines/tree-view/index.js +1279 -0
- package/dist/mutation-observer-_LbwtN3W.cjs +61 -0
- package/dist/mutation-observer-qObPUo3D.js +50 -0
- package/dist/navigate-CJOaL3vx.js +31 -0
- package/dist/navigate-uJG-006f.cjs +42 -0
- package/dist/overflow-BBihfMxX.cjs +67 -0
- package/dist/overflow-C-zO1CWA.js +44 -0
- package/dist/platform-BDB0wXUk.js +26 -0
- package/dist/platform-BZS-dkZN.cjs +109 -0
- package/dist/point-C9A4dk1i.js +27 -0
- package/dist/point-DxnCrJBy.cjs +32 -0
- package/dist/pointer-lock-BvfSjt_s.cjs +31 -0
- package/dist/pointer-lock-WezxTqu-.js +26 -0
- package/dist/pointer-move-CGzan38r.cjs +42 -0
- package/dist/pointer-move-Tijb8Ptk.js +37 -0
- package/dist/polygon-BvdwYRBw.js +76 -0
- package/dist/polygon-CTR1kEoU.cjs +93 -0
- package/dist/popper-DkAAS9VE.cjs +487 -0
- package/dist/popper-DzBZzAe4.js +464 -0
- package/dist/popper.cjs +6 -0
- package/dist/popper.d.cts +2 -0
- package/dist/popper.d.ts +2 -0
- package/dist/popper.js +2 -0
- package/dist/press-B7XLrLGR.js +65 -0
- package/dist/press-BdD5suLQ.cjs +70 -0
- package/dist/proxy-tab-focus-DWMXvAfO.js +54 -0
- package/dist/proxy-tab-focus-NthYgHdY.cjs +59 -0
- package/dist/raf-BSDcY4UD.cjs +85 -0
- package/dist/raf-DgINgykK.d.cts +15 -0
- package/dist/raf-DgINgykK.d.ts +15 -0
- package/dist/raf-Dhvm7f1e.js +62 -0
- package/dist/rect-utils-DiT4k3jS.cjs +548 -0
- package/dist/rect-utils-d_3gZVsc.js +459 -0
- package/dist/rect-utils.cjs +165 -0
- package/dist/rect-utils.d.cts +197 -0
- package/dist/rect-utils.d.ts +197 -0
- package/dist/rect-utils.js +116 -0
- package/dist/remove-scroll-DTVA5f4w.cjs +86 -0
- package/dist/remove-scroll-WEheFCiq.js +81 -0
- package/dist/remove-scroll.cjs +3 -0
- package/dist/remove-scroll.d.cts +4 -0
- package/dist/remove-scroll.d.ts +4 -0
- package/dist/remove-scroll.js +2 -0
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/scale-C5BBHVgH.js +17 -0
- package/dist/scale-C7iiUGhS.cjs +22 -0
- package/dist/scope-CysKlKe9.cjs +28 -0
- package/dist/scope-D1873Mzi.js +23 -0
- package/dist/scroll-CVJ40w2e.js +46 -0
- package/dist/scroll-Dyd1QLrc.cjs +63 -0
- package/dist/scroll-snap-Cuaqdevf.cjs +224 -0
- package/dist/scroll-snap-DqMiFASa.js +201 -0
- package/dist/scroll-snap.cjs +6 -0
- package/dist/scroll-snap.d.cts +14 -0
- package/dist/scroll-snap.d.ts +14 -0
- package/dist/scroll-snap.js +2 -0
- package/dist/selection-ClKhnWit.d.cts +49 -0
- package/dist/selection-DzLiSVkg.d.ts +49 -0
- package/dist/selection-map-962WvX2k.js +45 -0
- package/dist/selection-map-BwlZr1LH.cjs +68 -0
- package/dist/set-CFNGOW5W.js +50 -0
- package/dist/set-DrtWCLFb.cjs +73 -0
- package/dist/store-BLpJlMxz.js +257 -0
- package/dist/store-Btfrm2bs.cjs +47 -0
- package/dist/store-C5HvdLyc.js +42 -0
- package/dist/store-Wg8KVwNv.cjs +298 -0
- package/dist/store.cjs +9 -0
- package/dist/store.d.cts +26 -0
- package/dist/store.d.ts +26 -0
- package/dist/store.js +2 -0
- package/dist/stringify-state.cjs +48 -0
- package/dist/stringify-state.d.cts +8 -0
- package/dist/stringify-state.d.ts +8 -0
- package/dist/stringify-state.js +44 -0
- package/dist/tabbable-Bz1-1GAY.cjs +206 -0
- package/dist/tabbable-CDA1YMjZ.js +147 -0
- package/dist/text-selection-B3OQpQGy.cjs +75 -0
- package/dist/text-selection-DXvWvm6k.js +64 -0
- package/dist/timers-BRyPrXIX.js +82 -0
- package/dist/timers-Beu4SfAj.cjs +99 -0
- package/dist/tree-collection-3QX3EIhq.d.ts +77 -0
- package/dist/tree-collection-C6oDQGUJ.d.cts +77 -0
- package/dist/typeahead-DremEgML.d.cts +45 -0
- package/dist/typeahead-DremEgML.d.ts +45 -0
- package/dist/types-BFuHIo7S.js +10 -0
- package/dist/types-CczqoQLL.d.cts +57 -0
- package/dist/types-CczqoQLL.d.ts +57 -0
- package/dist/types-CjocssbC.d.cts +13 -0
- package/dist/types-CjocssbC.d.ts +13 -0
- package/dist/types-D7oF7eWh.d.cts +54 -0
- package/dist/types-D7oF7eWh.d.ts +54 -0
- package/dist/types-HCvp3Bhv.cjs +21 -0
- package/dist/types.cjs +14 -0
- package/dist/types.d.cts +6 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +12 -0
- package/dist/utils-BH-oBBz2.cjs +614 -0
- package/dist/utils-Cht5XaHf.js +267 -0
- package/dist/utils.cjs +95 -0
- package/dist/utils.d.cts +144 -0
- package/dist/utils.d.ts +144 -0
- package/dist/utils.js +7 -0
- package/dist/visually-hidden-BgSCFLz_.cjs +29 -0
- package/dist/visually-hidden-yDJ517KZ.js +18 -0
- package/dist/wait-for-3n85JcCU.d.cts +15 -0
- package/dist/wait-for-3n85JcCU.d.ts +15 -0
- package/dist/wait-for-CI5Ye-Lo.js +69 -0
- package/dist/wait-for-Db73VpZQ.cjs +86 -0
- package/dist/warning-CrzBpWT1.js +19 -0
- package/dist/warning-HAmFXLHm.cjs +42 -0
- package/package.json +349 -6
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
//#region src/common/utils/guard.ts
|
|
2
|
+
const isDev = () => process.env.NODE_ENV !== "production";
|
|
3
|
+
const isArray = (v) => Array.isArray(v);
|
|
4
|
+
const isBoolean = (v) => v === true || v === false;
|
|
5
|
+
const isObjectLike = (v) => v != null && typeof v === "object";
|
|
6
|
+
const isObject = (v) => isObjectLike(v) && !isArray(v);
|
|
7
|
+
const isNumber = (v) => typeof v === "number" && !Number.isNaN(v);
|
|
8
|
+
const isString = (v) => typeof v === "string";
|
|
9
|
+
const isFunction = (v) => typeof v === "function";
|
|
10
|
+
const isNull = (v) => v == null;
|
|
11
|
+
const hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
12
|
+
const baseGetTag = (v) => Object.prototype.toString.call(v);
|
|
13
|
+
const fnToString = Function.prototype.toString;
|
|
14
|
+
const objectCtorString = fnToString.call(Object);
|
|
15
|
+
const isPlainObject = (v) => {
|
|
16
|
+
if (!isObjectLike(v) || baseGetTag(v) != "[object Object]" || isFrameworkElement(v)) return false;
|
|
17
|
+
const proto = Object.getPrototypeOf(v);
|
|
18
|
+
if (proto === null) return true;
|
|
19
|
+
const Ctor = hasProp(proto, "constructor") && proto.constructor;
|
|
20
|
+
return typeof Ctor == "function" && Ctor instanceof Ctor && fnToString.call(Ctor) == objectCtorString;
|
|
21
|
+
};
|
|
22
|
+
const isReactElement = (x) => typeof x === "object" && x !== null && "$$typeof" in x && "props" in x;
|
|
23
|
+
const isVueElement = (x) => typeof x === "object" && x !== null && "__v_isVNode" in x;
|
|
24
|
+
const isFrameworkElement = (x) => isReactElement(x) || isVueElement(x);
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/common/utils/functions.ts
|
|
27
|
+
const runIfFn = (v, ...a) => {
|
|
28
|
+
return (typeof v === "function" ? v(...a) : v) ?? void 0;
|
|
29
|
+
};
|
|
30
|
+
const cast = (v) => v;
|
|
31
|
+
const identity = (v) => v();
|
|
32
|
+
const noop = () => {};
|
|
33
|
+
const callAll = (...fns) => (...a) => {
|
|
34
|
+
fns.forEach(function(fn) {
|
|
35
|
+
fn?.(...a);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const uuid = (() => {
|
|
39
|
+
let id = 0;
|
|
40
|
+
return () => {
|
|
41
|
+
id++;
|
|
42
|
+
return id.toString(36);
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
function match(key, record, ...args) {
|
|
46
|
+
if (key in record) {
|
|
47
|
+
const fn = record[key];
|
|
48
|
+
return isFunction(fn) ? fn(...args) : fn;
|
|
49
|
+
}
|
|
50
|
+
const error = /* @__PURE__ */ new Error(`No matching key: ${JSON.stringify(key)} in ${JSON.stringify(Object.keys(record))}`);
|
|
51
|
+
Error.captureStackTrace?.(error, match);
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
const tryCatch = (fn, fallback) => {
|
|
55
|
+
try {
|
|
56
|
+
return fn();
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Error) Error.captureStackTrace?.(error, tryCatch);
|
|
59
|
+
return fallback?.();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function throttle(fn, wait = 0) {
|
|
63
|
+
let lastCall = 0;
|
|
64
|
+
let timeout = null;
|
|
65
|
+
return ((...args) => {
|
|
66
|
+
const now = Date.now();
|
|
67
|
+
const timeSinceLastCall = now - lastCall;
|
|
68
|
+
if (timeSinceLastCall >= wait) {
|
|
69
|
+
if (timeout) {
|
|
70
|
+
clearTimeout(timeout);
|
|
71
|
+
timeout = null;
|
|
72
|
+
}
|
|
73
|
+
fn(...args);
|
|
74
|
+
lastCall = now;
|
|
75
|
+
} else if (!timeout) timeout = setTimeout(() => {
|
|
76
|
+
fn(...args);
|
|
77
|
+
lastCall = Date.now();
|
|
78
|
+
timeout = null;
|
|
79
|
+
}, wait - timeSinceLastCall);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function debounce(fn, wait = 0) {
|
|
83
|
+
let timeout = null;
|
|
84
|
+
return ((...args) => {
|
|
85
|
+
if (timeout) {
|
|
86
|
+
clearTimeout(timeout);
|
|
87
|
+
timeout = null;
|
|
88
|
+
}
|
|
89
|
+
timeout = setTimeout(() => {
|
|
90
|
+
fn(...args);
|
|
91
|
+
}, wait);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const toChar = (code) => String.fromCharCode(code + (code > 25 ? 39 : 97));
|
|
95
|
+
function toName(code) {
|
|
96
|
+
let name = "";
|
|
97
|
+
let x;
|
|
98
|
+
for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
|
|
99
|
+
return toChar(x % 52) + name;
|
|
100
|
+
}
|
|
101
|
+
function toPhash(h, x) {
|
|
102
|
+
let i = x.length;
|
|
103
|
+
while (i) h = h * 33 ^ x.charCodeAt(--i);
|
|
104
|
+
return h;
|
|
105
|
+
}
|
|
106
|
+
const hash = (value) => toName(toPhash(5381, value) >>> 0);
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/common/utils/number.ts
|
|
109
|
+
const { floor, abs, round, min, max, pow, sign } = Math;
|
|
110
|
+
const isNaN = (v) => Number.isNaN(v);
|
|
111
|
+
const nan = (v) => isNaN(v) ? 0 : v;
|
|
112
|
+
const mod = (v, m) => (v % m + m) % m;
|
|
113
|
+
const wrap = (v, vmax) => (v % vmax + vmax) % vmax;
|
|
114
|
+
const getMinValueAtIndex = (i, v, vmin) => i === 0 ? vmin : v[i - 1];
|
|
115
|
+
const getMaxValueAtIndex = (i, v, vmax) => i === v.length - 1 ? vmax : v[i + 1];
|
|
116
|
+
const isValueAtMax = (v, vmax) => nan(v) >= vmax;
|
|
117
|
+
const isValueAtMin = (v, vmin) => nan(v) <= vmin;
|
|
118
|
+
const isValueWithinRange = (v, vmin, vmax) => {
|
|
119
|
+
const value = nan(v);
|
|
120
|
+
return (vmin == null || value >= vmin) && (vmax == null || value <= vmax);
|
|
121
|
+
};
|
|
122
|
+
const roundValue = (v, vmin, step) => round((nan(v) - vmin) / step) * step + vmin;
|
|
123
|
+
const clampValue = (v, vmin, vmax) => min(max(nan(v), vmin), vmax);
|
|
124
|
+
const clampPercent = (v) => clampValue(v, 0, 1);
|
|
125
|
+
const getValuePercent = (v, vmin, vmax) => (nan(v) - vmin) / (vmax - vmin);
|
|
126
|
+
const getPercentValue = (p, vmin, vmax, step) => clampValue(roundValue(p * (vmax - vmin) + vmin, vmin, step), vmin, vmax);
|
|
127
|
+
const roundToStepPrecision = (v, step) => {
|
|
128
|
+
let rv = v;
|
|
129
|
+
let ss = step.toString();
|
|
130
|
+
let pi = ss.indexOf(".");
|
|
131
|
+
let p = pi >= 0 ? ss.length - pi : 0;
|
|
132
|
+
if (p > 0) {
|
|
133
|
+
let pw = pow(10, p);
|
|
134
|
+
rv = round(rv * pw) / pw;
|
|
135
|
+
}
|
|
136
|
+
return rv;
|
|
137
|
+
};
|
|
138
|
+
const roundToDpr = (v, dpr) => typeof dpr === "number" ? floor(v * dpr + .5) / dpr : round(v);
|
|
139
|
+
const snapValueToStep = (v, vmin, vmax, step) => {
|
|
140
|
+
const min = vmin != null ? Number(vmin) : 0;
|
|
141
|
+
const max = Number(vmax);
|
|
142
|
+
const remainder = (v - min) % step;
|
|
143
|
+
let snapped = abs(remainder) * 2 >= step ? v + sign(remainder) * (step - abs(remainder)) : v - remainder;
|
|
144
|
+
snapped = roundToStepPrecision(snapped, step);
|
|
145
|
+
if (!isNaN(min) && snapped < min) snapped = min;
|
|
146
|
+
else if (!isNaN(max) && snapped > max) {
|
|
147
|
+
const stepsInRange = floor((max - min) / step);
|
|
148
|
+
const largestValidStep = min + stepsInRange * step;
|
|
149
|
+
snapped = stepsInRange <= 0 || largestValidStep < min ? max : largestValidStep;
|
|
150
|
+
}
|
|
151
|
+
return roundToStepPrecision(snapped, step);
|
|
152
|
+
};
|
|
153
|
+
const setValueAtIndex = (vs, i, v) => {
|
|
154
|
+
if (vs[i] === v) return vs;
|
|
155
|
+
return [
|
|
156
|
+
...vs.slice(0, i),
|
|
157
|
+
v,
|
|
158
|
+
...vs.slice(i + 1)
|
|
159
|
+
];
|
|
160
|
+
};
|
|
161
|
+
function getValueSetterAtIndex(index, ctx) {
|
|
162
|
+
const minValueAtIndex = getMinValueAtIndex(index, ctx.values, ctx.min);
|
|
163
|
+
const maxValueAtIndex = getMaxValueAtIndex(index, ctx.values, ctx.max);
|
|
164
|
+
let nextValues = ctx.values.slice();
|
|
165
|
+
return function setValue(value) {
|
|
166
|
+
let nextValue = snapValueToStep(value, minValueAtIndex, maxValueAtIndex, ctx.step);
|
|
167
|
+
nextValues = setValueAtIndex(nextValues, index, value);
|
|
168
|
+
nextValues[index] = nextValue;
|
|
169
|
+
return nextValues;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function getNextStepValue(index, ctx) {
|
|
173
|
+
const nextValue = ctx.values[index] + ctx.step;
|
|
174
|
+
return getValueSetterAtIndex(index, ctx)(nextValue);
|
|
175
|
+
}
|
|
176
|
+
function getPreviousStepValue(index, ctx) {
|
|
177
|
+
const nextValue = ctx.values[index] - ctx.step;
|
|
178
|
+
return getValueSetterAtIndex(index, ctx)(nextValue);
|
|
179
|
+
}
|
|
180
|
+
const getClosestValueIndex = (vs, t) => {
|
|
181
|
+
let i = vs.findIndex((v) => t - v < 0);
|
|
182
|
+
if (i === 0) return i;
|
|
183
|
+
if (i === -1) return vs.length - 1;
|
|
184
|
+
let vLeft = vs[i - 1];
|
|
185
|
+
let vRight = vs[i];
|
|
186
|
+
if (abs(vLeft - t) < abs(vRight - t)) return i - 1;
|
|
187
|
+
return i;
|
|
188
|
+
};
|
|
189
|
+
const getClosestValue = (vs, t) => vs[getClosestValueIndex(vs, t)];
|
|
190
|
+
const getValueRanges = (vs, vmin, vmax, gap) => vs.map((v, i) => ({
|
|
191
|
+
min: i === 0 ? vmin : vs[i - 1] + gap,
|
|
192
|
+
max: i === vs.length - 1 ? vmax : vs[i + 1] - gap,
|
|
193
|
+
value: v
|
|
194
|
+
}));
|
|
195
|
+
const getValueTransformer = (va, vb) => {
|
|
196
|
+
const [a, b] = va;
|
|
197
|
+
const [c, d] = vb;
|
|
198
|
+
return (v) => a === b || c === d ? c : c + (d - c) / (b - a) * (v - a);
|
|
199
|
+
};
|
|
200
|
+
const toFixedNumber = (v, d = 0, b = 10) => {
|
|
201
|
+
const pow = Math.pow(b, d);
|
|
202
|
+
return round(v * pow) / pow;
|
|
203
|
+
};
|
|
204
|
+
const countDecimals = (value) => {
|
|
205
|
+
if (!Number.isFinite(value)) return 0;
|
|
206
|
+
let e = 1, p = 0;
|
|
207
|
+
while (Math.round(value * e) / e !== value) {
|
|
208
|
+
e *= 10;
|
|
209
|
+
p += 1;
|
|
210
|
+
}
|
|
211
|
+
return p;
|
|
212
|
+
};
|
|
213
|
+
const decimalOp = (a, op, b) => {
|
|
214
|
+
let result = op === "+" ? a + b : a - b;
|
|
215
|
+
if (a % 1 !== 0 || b % 1 !== 0) {
|
|
216
|
+
const multiplier = 10 ** Math.max(countDecimals(a), countDecimals(b));
|
|
217
|
+
a = Math.round(a * multiplier);
|
|
218
|
+
b = Math.round(b * multiplier);
|
|
219
|
+
result = op === "+" ? a + b : a - b;
|
|
220
|
+
result /= multiplier;
|
|
221
|
+
}
|
|
222
|
+
return result;
|
|
223
|
+
};
|
|
224
|
+
const incrementValue = (v, s) => decimalOp(nan(v), "+", s);
|
|
225
|
+
const decrementValue = (v, s) => decimalOp(nan(v), "-", s);
|
|
226
|
+
const toPx = (v) => typeof v === "number" ? `${v}px` : v;
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/common/utils/object.ts
|
|
229
|
+
function compact(obj) {
|
|
230
|
+
if (!isPlainObject(obj) || obj === void 0) return obj;
|
|
231
|
+
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
232
|
+
const filtered = {};
|
|
233
|
+
for (const key of keys) {
|
|
234
|
+
const value = obj[key];
|
|
235
|
+
if (value !== void 0) filtered[key] = compact(value);
|
|
236
|
+
}
|
|
237
|
+
return filtered;
|
|
238
|
+
}
|
|
239
|
+
const json = (v) => JSON.parse(JSON.stringify(v));
|
|
240
|
+
const keys = (obj) => Object.keys(obj);
|
|
241
|
+
function pick(obj, keys) {
|
|
242
|
+
const filtered = {};
|
|
243
|
+
for (const key of keys) {
|
|
244
|
+
const value = obj[key];
|
|
245
|
+
if (value !== void 0) filtered[key] = value;
|
|
246
|
+
}
|
|
247
|
+
return filtered;
|
|
248
|
+
}
|
|
249
|
+
function splitProps(props, keys) {
|
|
250
|
+
const rest = {};
|
|
251
|
+
const result = {};
|
|
252
|
+
const keySet = new Set(keys);
|
|
253
|
+
const ownKeys = Reflect.ownKeys(props);
|
|
254
|
+
for (const key of ownKeys) if (keySet.has(key)) result[key] = props[key];
|
|
255
|
+
else rest[key] = props[key];
|
|
256
|
+
return [result, rest];
|
|
257
|
+
}
|
|
258
|
+
const createSplitProps = (keys) => {
|
|
259
|
+
return function split(props) {
|
|
260
|
+
return splitProps(props, keys);
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
function omit(obj, keys) {
|
|
264
|
+
return createSplitProps(keys)(obj)[1];
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
export { isNull as $, roundToStepPrecision as A, hash as B, isNaN as C, mod as D, isValueWithinRange as E, toPx as F, throttle as G, match as H, wrap as I, hasProp as J, tryCatch as K, callAll as L, setValueAtIndex as M, snapValueToStep as N, nan as O, toFixedNumber as P, isFunction as Q, cast as R, incrementValue as S, isValueAtMin as T, noop as U, identity as V, runIfFn as W, isBoolean as X, isArray as Y, isDev as Z, getPreviousStepValue as _, omit as a, getValueSetterAtIndex as b, clampPercent as c, getClosestValue as d, isNumber as et, getClosestValueIndex as f, getPercentValue as g, getNextStepValue as h, keys as i, isString as it, roundValue as j, roundToDpr as k, clampValue as l, getMinValueAtIndex as m, createSplitProps as n, isObjectLike as nt, pick as o, getMaxValueAtIndex as p, uuid as q, json as r, isPlainObject as rt, splitProps as s, compact as t, isObject as tt, decrementValue as u, getValuePercent as v, isValueAtMax as w, getValueTransformer as x, getValueRanges as y, debounce as z };
|
package/dist/utils.cjs
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_array = require("./array-BGtygd0o.cjs");
|
|
3
|
+
const require_equal = require("./equal-C927y7MN.cjs");
|
|
4
|
+
const require_utils = require("./utils-BH-oBBz2.cjs");
|
|
5
|
+
const require_store = require("./store-Btfrm2bs.cjs");
|
|
6
|
+
const require_timers = require("./timers-Beu4SfAj.cjs");
|
|
7
|
+
const require_warning = require("./warning-HAmFXLHm.cjs");
|
|
8
|
+
exports.Timer = require_timers.Timer;
|
|
9
|
+
exports.add = require_array.add;
|
|
10
|
+
exports.addOrRemove = require_array.addOrRemove;
|
|
11
|
+
exports.callAll = require_utils.callAll;
|
|
12
|
+
exports.cast = require_utils.cast;
|
|
13
|
+
exports.chunk = require_array.chunk;
|
|
14
|
+
exports.clampPercent = require_utils.clampPercent;
|
|
15
|
+
exports.clampValue = require_utils.clampValue;
|
|
16
|
+
exports.clear = require_array.clear;
|
|
17
|
+
exports.compact = require_utils.compact;
|
|
18
|
+
exports.createSplitProps = require_utils.createSplitProps;
|
|
19
|
+
exports.createStore = require_store.createStore;
|
|
20
|
+
exports.debounce = require_utils.debounce;
|
|
21
|
+
exports.decrementValue = require_utils.decrementValue;
|
|
22
|
+
exports.diff = require_array.diff;
|
|
23
|
+
exports.ensure = require_warning.ensure;
|
|
24
|
+
exports.ensureProps = require_warning.ensureProps;
|
|
25
|
+
exports.first = require_array.first;
|
|
26
|
+
exports.flatArray = require_array.flatArray;
|
|
27
|
+
exports.fromLength = require_array.fromLength;
|
|
28
|
+
exports.getClosestValue = require_utils.getClosestValue;
|
|
29
|
+
exports.getClosestValueIndex = require_utils.getClosestValueIndex;
|
|
30
|
+
exports.getMaxValueAtIndex = require_utils.getMaxValueAtIndex;
|
|
31
|
+
exports.getMinValueAtIndex = require_utils.getMinValueAtIndex;
|
|
32
|
+
exports.getNextStepValue = require_utils.getNextStepValue;
|
|
33
|
+
exports.getPercentValue = require_utils.getPercentValue;
|
|
34
|
+
exports.getPreviousStepValue = require_utils.getPreviousStepValue;
|
|
35
|
+
exports.getValuePercent = require_utils.getValuePercent;
|
|
36
|
+
exports.getValueRanges = require_utils.getValueRanges;
|
|
37
|
+
exports.getValueSetterAtIndex = require_utils.getValueSetterAtIndex;
|
|
38
|
+
exports.getValueTransformer = require_utils.getValueTransformer;
|
|
39
|
+
exports.has = require_array.has;
|
|
40
|
+
exports.hasProp = require_utils.hasProp;
|
|
41
|
+
exports.hash = require_utils.hash;
|
|
42
|
+
exports.identity = require_utils.identity;
|
|
43
|
+
exports.incrementValue = require_utils.incrementValue;
|
|
44
|
+
exports.insertAt = require_array.insertAt;
|
|
45
|
+
exports.invariant = require_warning.invariant;
|
|
46
|
+
exports.isArray = require_utils.isArray;
|
|
47
|
+
exports.isBoolean = require_utils.isBoolean;
|
|
48
|
+
exports.isDev = require_utils.isDev;
|
|
49
|
+
exports.isEmpty = require_array.isEmpty;
|
|
50
|
+
exports.isEqual = require_equal.isEqual;
|
|
51
|
+
exports.isFunction = require_utils.isFunction;
|
|
52
|
+
exports.isNaN = require_utils.isNaN;
|
|
53
|
+
exports.isNull = require_utils.isNull;
|
|
54
|
+
exports.isNumber = require_utils.isNumber;
|
|
55
|
+
exports.isObject = require_utils.isObject;
|
|
56
|
+
exports.isObjectLike = require_utils.isObjectLike;
|
|
57
|
+
exports.isPlainObject = require_utils.isPlainObject;
|
|
58
|
+
exports.isString = require_utils.isString;
|
|
59
|
+
exports.isValueAtMax = require_utils.isValueAtMax;
|
|
60
|
+
exports.isValueAtMin = require_utils.isValueAtMin;
|
|
61
|
+
exports.isValueWithinRange = require_utils.isValueWithinRange;
|
|
62
|
+
exports.json = require_utils.json;
|
|
63
|
+
exports.keys = require_utils.keys;
|
|
64
|
+
exports.last = require_array.last;
|
|
65
|
+
exports.match = require_utils.match;
|
|
66
|
+
exports.mod = require_utils.mod;
|
|
67
|
+
exports.nan = require_utils.nan;
|
|
68
|
+
exports.next = require_array.next;
|
|
69
|
+
exports.nextIndex = require_array.nextIndex;
|
|
70
|
+
exports.noop = require_utils.noop;
|
|
71
|
+
exports.omit = require_utils.omit;
|
|
72
|
+
exports.partition = require_array.partition;
|
|
73
|
+
exports.pick = require_utils.pick;
|
|
74
|
+
exports.prev = require_array.prev;
|
|
75
|
+
exports.prevIndex = require_array.prevIndex;
|
|
76
|
+
exports.remove = require_array.remove;
|
|
77
|
+
exports.removeAt = require_array.removeAt;
|
|
78
|
+
exports.roundToDpr = require_utils.roundToDpr;
|
|
79
|
+
exports.roundToStepPrecision = require_utils.roundToStepPrecision;
|
|
80
|
+
exports.roundValue = require_utils.roundValue;
|
|
81
|
+
exports.runIfFn = require_utils.runIfFn;
|
|
82
|
+
exports.setRafInterval = require_timers.setRafInterval;
|
|
83
|
+
exports.setRafTimeout = require_timers.setRafTimeout;
|
|
84
|
+
exports.setValueAtIndex = require_utils.setValueAtIndex;
|
|
85
|
+
exports.snapValueToStep = require_utils.snapValueToStep;
|
|
86
|
+
exports.splitProps = require_utils.splitProps;
|
|
87
|
+
exports.throttle = require_utils.throttle;
|
|
88
|
+
exports.toArray = require_array.toArray;
|
|
89
|
+
exports.toFixedNumber = require_utils.toFixedNumber;
|
|
90
|
+
exports.toPx = require_utils.toPx;
|
|
91
|
+
exports.tryCatch = require_utils.tryCatch;
|
|
92
|
+
exports.uniq = require_array.uniq;
|
|
93
|
+
exports.uuid = require_utils.uuid;
|
|
94
|
+
exports.warn = require_warning.warn;
|
|
95
|
+
exports.wrap = require_utils.wrap;
|
package/dist/utils.d.cts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { a as debounce, c as match, d as throttle, f as tryCatch, i as cast, l as noop, n as Nullable, o as hash, p as uuid, r as callAll, s as identity, t as MaybeFunction, u as runIfFn } from "./functions-isw5Ovcx.cjs";
|
|
2
|
+
//#region src/common/utils/array.d.ts
|
|
3
|
+
declare function toArray<T>(v: T | T[] | undefined | null): T[];
|
|
4
|
+
declare const fromLength: (length: number) => number[];
|
|
5
|
+
declare const first: <T>(v: T[]) => T | undefined;
|
|
6
|
+
declare const last: <T>(v: T[]) => T | undefined;
|
|
7
|
+
declare const isEmpty: <T>(v: T[]) => boolean;
|
|
8
|
+
declare const has: <T>(v: T[], t: T) => boolean;
|
|
9
|
+
declare const add: <T>(v: T[], ...items: T[]) => T[];
|
|
10
|
+
declare const remove: <T>(v: T[], ...items: T[]) => T[];
|
|
11
|
+
declare const removeAt: <T>(v: T[], i: number) => T[];
|
|
12
|
+
declare const insertAt: <T>(v: T[], i: number, ...items: T[]) => T[];
|
|
13
|
+
declare const uniq: <T>(v: T[]) => T[];
|
|
14
|
+
declare const diff: <T>(a: T[], b: T[]) => T[];
|
|
15
|
+
declare const addOrRemove: <T>(v: T[], item: T) => T[];
|
|
16
|
+
declare function clear<T>(v: T[]): T[];
|
|
17
|
+
type IndexOptions = {
|
|
18
|
+
step?: number | undefined;
|
|
19
|
+
loop?: boolean | undefined;
|
|
20
|
+
};
|
|
21
|
+
declare function nextIndex<T>(v: T[], idx: number, opts?: IndexOptions): number;
|
|
22
|
+
declare function next<T>(v: T[], idx: number, opts?: IndexOptions): T | undefined;
|
|
23
|
+
declare function prevIndex<T>(v: T[], idx: number, opts?: IndexOptions): number;
|
|
24
|
+
declare function prev<T>(v: T[], index: number, opts?: IndexOptions): T | undefined;
|
|
25
|
+
declare function chunk<T>(v: T[], size: number): T[][];
|
|
26
|
+
declare function flatArray<T>(arr: T[]): T[];
|
|
27
|
+
declare function partition<T>(arr: T[], fn: (value: T) => boolean): [T[], T[]];
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/common/utils/equal.d.ts
|
|
30
|
+
declare const isEqual: (a: any, b: any) => boolean;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/common/utils/guard.d.ts
|
|
33
|
+
type AnyFunction = (...args: any[]) => any;
|
|
34
|
+
declare const isDev: () => boolean;
|
|
35
|
+
declare const isArray: (v: any) => v is any[];
|
|
36
|
+
declare const isBoolean: (v: any) => v is boolean;
|
|
37
|
+
declare const isObjectLike: (v: any) => v is Record<string, any>;
|
|
38
|
+
declare const isObject: (v: any) => v is Record<string, any>;
|
|
39
|
+
declare const isNumber: (v: any) => v is number;
|
|
40
|
+
declare const isString: (v: any) => v is string;
|
|
41
|
+
declare const isFunction: (v: any) => v is AnyFunction;
|
|
42
|
+
declare const isNull: (v: any) => v is null | undefined;
|
|
43
|
+
declare const hasProp: <T extends string>(obj: any, prop: T) => obj is Record<T, any>;
|
|
44
|
+
declare const isPlainObject: (v: any) => boolean;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/common/utils/number.d.ts
|
|
47
|
+
declare const isNaN: (v: number) => boolean;
|
|
48
|
+
declare const nan: (v: number) => number;
|
|
49
|
+
declare const mod: (v: number, m: number) => number;
|
|
50
|
+
declare const wrap: (v: number, vmax: number) => number;
|
|
51
|
+
declare const getMinValueAtIndex: (i: number, v: number[], vmin: number) => number;
|
|
52
|
+
declare const getMaxValueAtIndex: (i: number, v: number[], vmax: number) => number;
|
|
53
|
+
declare const isValueAtMax: (v: number, vmax: number) => boolean;
|
|
54
|
+
declare const isValueAtMin: (v: number, vmin: number) => boolean;
|
|
55
|
+
declare const isValueWithinRange: (v: number, vmin: number | null | undefined, vmax: number | null | undefined) => boolean;
|
|
56
|
+
declare const roundValue: (v: number, vmin: number, step: number) => number;
|
|
57
|
+
declare const clampValue: (v: number, vmin: number, vmax: number) => number;
|
|
58
|
+
declare const clampPercent: (v: number) => number;
|
|
59
|
+
declare const getValuePercent: (v: number, vmin: number, vmax: number) => number;
|
|
60
|
+
declare const getPercentValue: (p: number, vmin: number, vmax: number, step: number) => number;
|
|
61
|
+
declare const roundToStepPrecision: (v: number, step: number) => number;
|
|
62
|
+
declare const roundToDpr: (v: number, dpr: unknown) => number;
|
|
63
|
+
declare const snapValueToStep: (v: number, vmin: number | undefined, vmax: number | undefined, step: number) => number;
|
|
64
|
+
declare const setValueAtIndex: <T>(vs: T[], i: number, v: T) => T[];
|
|
65
|
+
interface RangeContext {
|
|
66
|
+
min: number;
|
|
67
|
+
max: number;
|
|
68
|
+
step: number;
|
|
69
|
+
values: number[];
|
|
70
|
+
}
|
|
71
|
+
declare function getValueSetterAtIndex(index: number, ctx: RangeContext): (value: number) => number[];
|
|
72
|
+
declare function getNextStepValue(index: number, ctx: RangeContext): number[];
|
|
73
|
+
declare function getPreviousStepValue(index: number, ctx: RangeContext): number[];
|
|
74
|
+
declare const getClosestValueIndex: (vs: number[], t: number) => number;
|
|
75
|
+
declare const getClosestValue: (vs: number[], t: number) => number;
|
|
76
|
+
declare const getValueRanges: (vs: number[], vmin: number, vmax: number, gap: number) => {
|
|
77
|
+
min: number;
|
|
78
|
+
max: number;
|
|
79
|
+
value: number;
|
|
80
|
+
}[];
|
|
81
|
+
declare const getValueTransformer: (va: number[], vb: number[]) => (v: number) => number;
|
|
82
|
+
declare const toFixedNumber: (v: number, d?: number, b?: number) => number;
|
|
83
|
+
declare const incrementValue: (v: number, s: number) => number;
|
|
84
|
+
declare const decrementValue: (v: number, s: number) => number;
|
|
85
|
+
declare const toPx: (v: number | string | undefined) => string | undefined;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/common/utils/object.d.ts
|
|
88
|
+
declare function compact<T extends Record<string, unknown> | undefined>(obj: T): T;
|
|
89
|
+
declare const json: (v: any) => any;
|
|
90
|
+
declare const keys: <T extends Record<string, any>>(obj: T) => (keyof T)[];
|
|
91
|
+
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
92
|
+
type Dict = Record<string | symbol, any>;
|
|
93
|
+
declare function splitProps<T extends Dict>(props: T, keys: (keyof T)[]): Dict[];
|
|
94
|
+
declare const createSplitProps: <T extends Dict>(keys: (keyof T)[]) => <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];
|
|
95
|
+
declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/common/utils/store.d.ts
|
|
98
|
+
type StoreListener = VoidFunction;
|
|
99
|
+
type StoreCompareFn<T> = (a: T, b: T) => boolean;
|
|
100
|
+
declare function createStore<T extends Record<string, any>>(initialState: T, compare?: StoreCompareFn<T>): Store<T>;
|
|
101
|
+
interface Store<T extends Record<string, any>> {
|
|
102
|
+
subscribe: (listener: StoreListener) => () => void;
|
|
103
|
+
get: <K extends keyof T>(key: K) => T[K];
|
|
104
|
+
set: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
105
|
+
update: (updates: Partial<T>) => void;
|
|
106
|
+
snapshot: () => T;
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/common/utils/timers.d.ts
|
|
110
|
+
interface TimerBaseContext {
|
|
111
|
+
startMs: number;
|
|
112
|
+
deltaMs: number;
|
|
113
|
+
}
|
|
114
|
+
interface TimerContext extends TimerBaseContext {
|
|
115
|
+
now: number;
|
|
116
|
+
}
|
|
117
|
+
type TimerContextFn = (ctx: TimerContext) => boolean | void;
|
|
118
|
+
declare class Timer {
|
|
119
|
+
#private;
|
|
120
|
+
private readonly onTick;
|
|
121
|
+
private frameId;
|
|
122
|
+
private pausedAtMs;
|
|
123
|
+
private context;
|
|
124
|
+
constructor(onTick: TimerContextFn);
|
|
125
|
+
private cancelFrame;
|
|
126
|
+
setStartMs: (startMs: number) => void;
|
|
127
|
+
get elapsedMs(): number;
|
|
128
|
+
start: () => void;
|
|
129
|
+
pause: () => void;
|
|
130
|
+
stop: () => void;
|
|
131
|
+
}
|
|
132
|
+
declare function setRafInterval(fn: (ctx: TimerBaseContext) => void, intervalMs: number): () => void;
|
|
133
|
+
declare function setRafTimeout(fn: () => void, delayMs: number): () => void;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/common/utils/warning.d.ts
|
|
136
|
+
declare function warn(m: string): void;
|
|
137
|
+
declare function warn(c: boolean, m: string): void;
|
|
138
|
+
declare function invariant(m: string): void;
|
|
139
|
+
declare function invariant(c: boolean, m: string): void;
|
|
140
|
+
declare function ensure<T>(c: T | null | undefined, m: () => string): asserts c is T;
|
|
141
|
+
type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
142
|
+
declare function ensureProps<T, K extends keyof T>(props: T, keys: K[], scope?: string): asserts props is T & RequiredBy<T, K>;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { IndexOptions, MaybeFunction, Nullable, Store, StoreCompareFn, StoreListener, Timer, TimerBaseContext, TimerContextFn, add, addOrRemove, callAll, cast, chunk, clampPercent, clampValue, clear, compact, createSplitProps, createStore, debounce, decrementValue, diff, ensure, ensureProps, first, flatArray, fromLength, getClosestValue, getClosestValueIndex, getMaxValueAtIndex, getMinValueAtIndex, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, getValueSetterAtIndex, getValueTransformer, has, hasProp, hash, identity, incrementValue, insertAt, invariant, isArray, isBoolean, isDev, isEmpty, isEqual, isFunction, isNaN, isNull, isNumber, isObject, isObjectLike, isPlainObject, isString, isValueAtMax, isValueAtMin, isValueWithinRange, json, keys, last, match, mod, nan, next, nextIndex, noop, omit, partition, pick, prev, prevIndex, remove, removeAt, roundToDpr, roundToStepPrecision, roundValue, runIfFn, setRafInterval, setRafTimeout, setValueAtIndex, snapValueToStep, splitProps, throttle, toArray, toFixedNumber, toPx, tryCatch, uniq, uuid, warn, wrap };
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { a as debounce, c as match, d as throttle, f as tryCatch, i as cast, l as noop, n as Nullable, o as hash, p as uuid, r as callAll, s as identity, t as MaybeFunction, u as runIfFn } from "./functions-isw5Ovcx.js";
|
|
2
|
+
//#region src/common/utils/array.d.ts
|
|
3
|
+
declare function toArray<T>(v: T | T[] | undefined | null): T[];
|
|
4
|
+
declare const fromLength: (length: number) => number[];
|
|
5
|
+
declare const first: <T>(v: T[]) => T | undefined;
|
|
6
|
+
declare const last: <T>(v: T[]) => T | undefined;
|
|
7
|
+
declare const isEmpty: <T>(v: T[]) => boolean;
|
|
8
|
+
declare const has: <T>(v: T[], t: T) => boolean;
|
|
9
|
+
declare const add: <T>(v: T[], ...items: T[]) => T[];
|
|
10
|
+
declare const remove: <T>(v: T[], ...items: T[]) => T[];
|
|
11
|
+
declare const removeAt: <T>(v: T[], i: number) => T[];
|
|
12
|
+
declare const insertAt: <T>(v: T[], i: number, ...items: T[]) => T[];
|
|
13
|
+
declare const uniq: <T>(v: T[]) => T[];
|
|
14
|
+
declare const diff: <T>(a: T[], b: T[]) => T[];
|
|
15
|
+
declare const addOrRemove: <T>(v: T[], item: T) => T[];
|
|
16
|
+
declare function clear<T>(v: T[]): T[];
|
|
17
|
+
type IndexOptions = {
|
|
18
|
+
step?: number | undefined;
|
|
19
|
+
loop?: boolean | undefined;
|
|
20
|
+
};
|
|
21
|
+
declare function nextIndex<T>(v: T[], idx: number, opts?: IndexOptions): number;
|
|
22
|
+
declare function next<T>(v: T[], idx: number, opts?: IndexOptions): T | undefined;
|
|
23
|
+
declare function prevIndex<T>(v: T[], idx: number, opts?: IndexOptions): number;
|
|
24
|
+
declare function prev<T>(v: T[], index: number, opts?: IndexOptions): T | undefined;
|
|
25
|
+
declare function chunk<T>(v: T[], size: number): T[][];
|
|
26
|
+
declare function flatArray<T>(arr: T[]): T[];
|
|
27
|
+
declare function partition<T>(arr: T[], fn: (value: T) => boolean): [T[], T[]];
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/common/utils/equal.d.ts
|
|
30
|
+
declare const isEqual: (a: any, b: any) => boolean;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/common/utils/guard.d.ts
|
|
33
|
+
type AnyFunction = (...args: any[]) => any;
|
|
34
|
+
declare const isDev: () => boolean;
|
|
35
|
+
declare const isArray: (v: any) => v is any[];
|
|
36
|
+
declare const isBoolean: (v: any) => v is boolean;
|
|
37
|
+
declare const isObjectLike: (v: any) => v is Record<string, any>;
|
|
38
|
+
declare const isObject: (v: any) => v is Record<string, any>;
|
|
39
|
+
declare const isNumber: (v: any) => v is number;
|
|
40
|
+
declare const isString: (v: any) => v is string;
|
|
41
|
+
declare const isFunction: (v: any) => v is AnyFunction;
|
|
42
|
+
declare const isNull: (v: any) => v is null | undefined;
|
|
43
|
+
declare const hasProp: <T extends string>(obj: any, prop: T) => obj is Record<T, any>;
|
|
44
|
+
declare const isPlainObject: (v: any) => boolean;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/common/utils/number.d.ts
|
|
47
|
+
declare const isNaN: (v: number) => boolean;
|
|
48
|
+
declare const nan: (v: number) => number;
|
|
49
|
+
declare const mod: (v: number, m: number) => number;
|
|
50
|
+
declare const wrap: (v: number, vmax: number) => number;
|
|
51
|
+
declare const getMinValueAtIndex: (i: number, v: number[], vmin: number) => number;
|
|
52
|
+
declare const getMaxValueAtIndex: (i: number, v: number[], vmax: number) => number;
|
|
53
|
+
declare const isValueAtMax: (v: number, vmax: number) => boolean;
|
|
54
|
+
declare const isValueAtMin: (v: number, vmin: number) => boolean;
|
|
55
|
+
declare const isValueWithinRange: (v: number, vmin: number | null | undefined, vmax: number | null | undefined) => boolean;
|
|
56
|
+
declare const roundValue: (v: number, vmin: number, step: number) => number;
|
|
57
|
+
declare const clampValue: (v: number, vmin: number, vmax: number) => number;
|
|
58
|
+
declare const clampPercent: (v: number) => number;
|
|
59
|
+
declare const getValuePercent: (v: number, vmin: number, vmax: number) => number;
|
|
60
|
+
declare const getPercentValue: (p: number, vmin: number, vmax: number, step: number) => number;
|
|
61
|
+
declare const roundToStepPrecision: (v: number, step: number) => number;
|
|
62
|
+
declare const roundToDpr: (v: number, dpr: unknown) => number;
|
|
63
|
+
declare const snapValueToStep: (v: number, vmin: number | undefined, vmax: number | undefined, step: number) => number;
|
|
64
|
+
declare const setValueAtIndex: <T>(vs: T[], i: number, v: T) => T[];
|
|
65
|
+
interface RangeContext {
|
|
66
|
+
min: number;
|
|
67
|
+
max: number;
|
|
68
|
+
step: number;
|
|
69
|
+
values: number[];
|
|
70
|
+
}
|
|
71
|
+
declare function getValueSetterAtIndex(index: number, ctx: RangeContext): (value: number) => number[];
|
|
72
|
+
declare function getNextStepValue(index: number, ctx: RangeContext): number[];
|
|
73
|
+
declare function getPreviousStepValue(index: number, ctx: RangeContext): number[];
|
|
74
|
+
declare const getClosestValueIndex: (vs: number[], t: number) => number;
|
|
75
|
+
declare const getClosestValue: (vs: number[], t: number) => number;
|
|
76
|
+
declare const getValueRanges: (vs: number[], vmin: number, vmax: number, gap: number) => {
|
|
77
|
+
min: number;
|
|
78
|
+
max: number;
|
|
79
|
+
value: number;
|
|
80
|
+
}[];
|
|
81
|
+
declare const getValueTransformer: (va: number[], vb: number[]) => (v: number) => number;
|
|
82
|
+
declare const toFixedNumber: (v: number, d?: number, b?: number) => number;
|
|
83
|
+
declare const incrementValue: (v: number, s: number) => number;
|
|
84
|
+
declare const decrementValue: (v: number, s: number) => number;
|
|
85
|
+
declare const toPx: (v: number | string | undefined) => string | undefined;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/common/utils/object.d.ts
|
|
88
|
+
declare function compact<T extends Record<string, unknown> | undefined>(obj: T): T;
|
|
89
|
+
declare const json: (v: any) => any;
|
|
90
|
+
declare const keys: <T extends Record<string, any>>(obj: T) => (keyof T)[];
|
|
91
|
+
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
92
|
+
type Dict = Record<string | symbol, any>;
|
|
93
|
+
declare function splitProps<T extends Dict>(props: T, keys: (keyof T)[]): Dict[];
|
|
94
|
+
declare const createSplitProps: <T extends Dict>(keys: (keyof T)[]) => <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];
|
|
95
|
+
declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/common/utils/store.d.ts
|
|
98
|
+
type StoreListener = VoidFunction;
|
|
99
|
+
type StoreCompareFn<T> = (a: T, b: T) => boolean;
|
|
100
|
+
declare function createStore<T extends Record<string, any>>(initialState: T, compare?: StoreCompareFn<T>): Store<T>;
|
|
101
|
+
interface Store<T extends Record<string, any>> {
|
|
102
|
+
subscribe: (listener: StoreListener) => () => void;
|
|
103
|
+
get: <K extends keyof T>(key: K) => T[K];
|
|
104
|
+
set: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
105
|
+
update: (updates: Partial<T>) => void;
|
|
106
|
+
snapshot: () => T;
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/common/utils/timers.d.ts
|
|
110
|
+
interface TimerBaseContext {
|
|
111
|
+
startMs: number;
|
|
112
|
+
deltaMs: number;
|
|
113
|
+
}
|
|
114
|
+
interface TimerContext extends TimerBaseContext {
|
|
115
|
+
now: number;
|
|
116
|
+
}
|
|
117
|
+
type TimerContextFn = (ctx: TimerContext) => boolean | void;
|
|
118
|
+
declare class Timer {
|
|
119
|
+
#private;
|
|
120
|
+
private readonly onTick;
|
|
121
|
+
private frameId;
|
|
122
|
+
private pausedAtMs;
|
|
123
|
+
private context;
|
|
124
|
+
constructor(onTick: TimerContextFn);
|
|
125
|
+
private cancelFrame;
|
|
126
|
+
setStartMs: (startMs: number) => void;
|
|
127
|
+
get elapsedMs(): number;
|
|
128
|
+
start: () => void;
|
|
129
|
+
pause: () => void;
|
|
130
|
+
stop: () => void;
|
|
131
|
+
}
|
|
132
|
+
declare function setRafInterval(fn: (ctx: TimerBaseContext) => void, intervalMs: number): () => void;
|
|
133
|
+
declare function setRafTimeout(fn: () => void, delayMs: number): () => void;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/common/utils/warning.d.ts
|
|
136
|
+
declare function warn(m: string): void;
|
|
137
|
+
declare function warn(c: boolean, m: string): void;
|
|
138
|
+
declare function invariant(m: string): void;
|
|
139
|
+
declare function invariant(c: boolean, m: string): void;
|
|
140
|
+
declare function ensure<T>(c: T | null | undefined, m: () => string): asserts c is T;
|
|
141
|
+
type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
142
|
+
declare function ensureProps<T, K extends keyof T>(props: T, keys: K[], scope?: string): asserts props is T & RequiredBy<T, K>;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { IndexOptions, MaybeFunction, Nullable, Store, StoreCompareFn, StoreListener, Timer, TimerBaseContext, TimerContextFn, add, addOrRemove, callAll, cast, chunk, clampPercent, clampValue, clear, compact, createSplitProps, createStore, debounce, decrementValue, diff, ensure, ensureProps, first, flatArray, fromLength, getClosestValue, getClosestValueIndex, getMaxValueAtIndex, getMinValueAtIndex, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, getValueSetterAtIndex, getValueTransformer, has, hasProp, hash, identity, incrementValue, insertAt, invariant, isArray, isBoolean, isDev, isEmpty, isEqual, isFunction, isNaN, isNull, isNumber, isObject, isObjectLike, isPlainObject, isString, isValueAtMax, isValueAtMin, isValueWithinRange, json, keys, last, match, mod, nan, next, nextIndex, noop, omit, partition, pick, prev, prevIndex, remove, removeAt, roundToDpr, roundToStepPrecision, roundValue, runIfFn, setRafInterval, setRafTimeout, setValueAtIndex, snapValueToStep, splitProps, throttle, toArray, toFixedNumber, toPx, tryCatch, uniq, uuid, warn, wrap };
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { _ as prevIndex, a as diff, b as toArray, c as fromLength, d as isEmpty, f as last, g as prev, h as partition, i as clear, l as has, m as nextIndex, n as addOrRemove, o as first, p as next, r as chunk, s as flatArray, t as add, u as insertAt, v as remove, x as uniq, y as removeAt } from "./array-C4KbHsha.js";
|
|
2
|
+
import { t as isEqual } from "./equal-DtrP8DPh.js";
|
|
3
|
+
import { $ as isNull, A as roundToStepPrecision, B as hash, C as isNaN, D as mod, E as isValueWithinRange, F as toPx, G as throttle, H as match, I as wrap, J as hasProp, K as tryCatch, L as callAll, M as setValueAtIndex, N as snapValueToStep, O as nan, P as toFixedNumber, Q as isFunction, R as cast, S as incrementValue, T as isValueAtMin, U as noop, V as identity, W as runIfFn, X as isBoolean, Y as isArray, Z as isDev, _ as getPreviousStepValue, a as omit, b as getValueSetterAtIndex, c as clampPercent, d as getClosestValue, et as isNumber, f as getClosestValueIndex, g as getPercentValue, h as getNextStepValue, i as keys, it as isString, j as roundValue, k as roundToDpr, l as clampValue, m as getMinValueAtIndex, n as createSplitProps, nt as isObjectLike, o as pick, p as getMaxValueAtIndex, q as uuid, r as json, rt as isPlainObject, s as splitProps, t as compact, tt as isObject, u as decrementValue, v as getValuePercent, w as isValueAtMax, x as getValueTransformer, y as getValueRanges, z as debounce } from "./utils-Cht5XaHf.js";
|
|
4
|
+
import { t as createStore } from "./store-C5HvdLyc.js";
|
|
5
|
+
import { n as setRafInterval, r as setRafTimeout, t as Timer } from "./timers-BRyPrXIX.js";
|
|
6
|
+
import { i as warn, n as ensureProps, r as invariant, t as ensure } from "./warning-CrzBpWT1.js";
|
|
7
|
+
export { Timer, add, addOrRemove, callAll, cast, chunk, clampPercent, clampValue, clear, compact, createSplitProps, createStore, debounce, decrementValue, diff, ensure, ensureProps, first, flatArray, fromLength, getClosestValue, getClosestValueIndex, getMaxValueAtIndex, getMinValueAtIndex, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, getValueSetterAtIndex, getValueTransformer, has, hasProp, hash, identity, incrementValue, insertAt, invariant, isArray, isBoolean, isDev, isEmpty, isEqual, isFunction, isNaN, isNull, isNumber, isObject, isObjectLike, isPlainObject, isString, isValueAtMax, isValueAtMin, isValueWithinRange, json, keys, last, match, mod, nan, next, nextIndex, noop, omit, partition, pick, prev, prevIndex, remove, removeAt, roundToDpr, roundToStepPrecision, roundValue, runIfFn, setRafInterval, setRafTimeout, setValueAtIndex, snapValueToStep, splitProps, throttle, toArray, toFixedNumber, toPx, tryCatch, uniq, uuid, warn, wrap };
|