@design-edito/tools 0.3.9 → 0.3.11
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/agnostic/arrays/index.d.ts +2 -2
- package/agnostic/arrays/index.js +2 -2
- package/agnostic/arrays/is-array-of/index.d.ts +1 -1
- package/agnostic/arrays/is-array-of/index.js +2 -2
- package/agnostic/booleans/is-falsy/index.d.ts +1 -1
- package/agnostic/colors/channels/index.d.ts +1 -1
- package/agnostic/colors/contrast/index.d.ts +1 -1
- package/agnostic/colors/convert/index.d.ts +1 -1
- package/agnostic/colors/convert/index.js +14 -17
- package/agnostic/colors/cssColorsMap.d.ts +9 -0
- package/agnostic/colors/distance/index.d.ts +1 -1
- package/agnostic/colors/index.d.ts +3 -3
- package/agnostic/colors/index.js +3 -3
- package/agnostic/colors/invert/index.d.ts +1 -1
- package/agnostic/colors/luminance/index.d.ts +1 -1
- package/agnostic/colors/palette/index.js +2 -0
- package/agnostic/colors/tidy/index.js +2 -1
- package/agnostic/colors/typechecks/index.d.ts +1 -1
- package/agnostic/colors/typechecks/index.js +1 -3
- package/agnostic/colors/types.d.ts +0 -7
- package/agnostic/colors/types.js +0 -154
- package/agnostic/css/bem/index.d.ts +3 -3
- package/agnostic/css/bem/index.js +6 -5
- package/agnostic/css/clss/index.d.ts +54 -1
- package/agnostic/css/clss/index.js +3 -3
- package/agnostic/css/generate-nice-color/index.js +1 -0
- package/agnostic/css/index.d.ts +1 -1
- package/agnostic/css/index.js +1 -1
- package/agnostic/css/styles-set/index.d.ts +4 -4
- package/agnostic/css/styles-set/index.js +1 -1
- package/agnostic/errors/index.d.ts +1 -1
- package/agnostic/errors/index.js +1 -1
- package/agnostic/errors/register/index.js +4 -2
- package/agnostic/html/get-node-ancestors/index.js +1 -1
- package/agnostic/html/get-position-inside-parent/index.js +1 -1
- package/agnostic/html/hyper-json/cast/index.d.ts +1 -1
- package/agnostic/html/hyper-json/method/index.d.ts +2 -2
- package/agnostic/html/hyper-json/serialize/index.d.ts +1 -1
- package/agnostic/html/hyper-json/serialize/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +5 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +5 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +14 -14
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +14 -14
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +7 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +7 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +0 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -1
- package/agnostic/html/hyper-json/transformer/index.d.ts +2 -2
- package/agnostic/html/hyper-json/transformer/index.js +6 -9
- package/agnostic/html/hyper-json/tree/index.d.ts +1 -1
- package/agnostic/html/hyper-json/tree/index.js +14 -10
- package/agnostic/html/hyper-json/types/index.d.ts +9 -13
- package/agnostic/html/hyper-json/utils/index.d.ts +7 -7
- package/agnostic/html/hyper-json/utils/index.js +1 -1
- package/agnostic/html/index.d.ts +1 -1
- package/agnostic/html/index.js +1 -1
- package/agnostic/html/placeholders/index.d.ts +1 -1
- package/agnostic/html/selector-to-element/index.js +1 -1
- package/agnostic/index.d.ts +6 -6
- package/agnostic/index.js +6 -6
- package/agnostic/misc/assert/index.d.ts +5 -2
- package/agnostic/misc/assert/index.js +4 -4
- package/agnostic/misc/cast/index.d.ts +1 -1
- package/agnostic/misc/connection/index.js +0 -1
- package/agnostic/misc/crawler/index.d.ts +2 -2
- package/agnostic/misc/crossenv/detect-runtime/index.js +4 -4
- package/agnostic/misc/crossenv/index.d.ts +1 -1
- package/agnostic/misc/crossenv/index.js +1 -1
- package/agnostic/misc/crossenv/window/index.d.ts +1 -1
- package/agnostic/misc/crossenv/window/index.js +2 -2
- package/agnostic/misc/data-size/index.js +2 -2
- package/agnostic/misc/index.d.ts +6 -6
- package/agnostic/misc/index.js +6 -6
- package/agnostic/misc/is-constructor-function/index.d.ts +1 -1
- package/agnostic/misc/logs/logger/index.d.ts +11 -1
- package/agnostic/misc/logs/logger/index.js +40 -10
- package/agnostic/misc/logs/styles/index.d.ts +1 -0
- package/agnostic/misc/logs/styles/index.js +27 -9
- package/agnostic/misc/outcome/index.d.ts +7 -7
- package/agnostic/numbers/approximate-rational/index.js +4 -2
- package/agnostic/numbers/index.d.ts +3 -3
- package/agnostic/numbers/index.js +3 -3
- package/agnostic/objects/deep-get-property/index.js +2 -2
- package/agnostic/objects/flatten-getters/index.js +2 -1
- package/agnostic/objects/index.d.ts +5 -4
- package/agnostic/objects/index.js +5 -4
- package/agnostic/objects/record-format/index.js +1 -0
- package/agnostic/objects/sort-keys/index.d.ts +11 -0
- package/agnostic/objects/sort-keys/index.js +12 -0
- package/agnostic/objects/sort-keys/index.test.d.ts +1 -0
- package/agnostic/optim/memoize/index.js +1 -1
- package/agnostic/optim/throttle-debounce/index.d.ts +12 -10
- package/agnostic/optim/throttle-debounce/index.js +2 -2
- package/agnostic/optim/throttle-debounce/types.d.ts +1 -1
- package/agnostic/random/index.d.ts +1 -1
- package/agnostic/random/index.js +1 -1
- package/agnostic/random/random/index.js +1 -1
- package/agnostic/sanitization/html/index.js +7 -7
- package/agnostic/sanitization/index.d.ts +1 -1
- package/agnostic/sanitization/index.js +1 -1
- package/agnostic/sanitization/types.d.ts +2 -6
- package/agnostic/strings/char-codes/index.d.ts +5 -5
- package/agnostic/strings/char-codes/index.js +2 -2
- package/agnostic/strings/index.d.ts +3 -3
- package/agnostic/strings/index.js +3 -3
- package/agnostic/strings/matches/index.d.ts +2 -2
- package/agnostic/time/dates/format-date/index.js +23 -9
- package/agnostic/time/duration/index.d.ts +23 -2
- package/agnostic/time/duration/index.js +36 -4
- package/agnostic/time/index.d.ts +2 -2
- package/agnostic/time/index.js +2 -2
- package/agnostic/time/timeout/index.js +2 -2
- package/agnostic/time/transitions/index.d.ts +3 -3
- package/agnostic/time/transitions/index.js +4 -4
- package/agnostic/time/wait/index.d.ts +2 -2
- package/agnostic/time/wait/index.js +1 -1
- package/components/Disclaimer/index.d.ts +45 -0
- package/components/Disclaimer/index.js +70 -0
- package/components/Drawer/index.d.ts +45 -0
- package/components/Drawer/index.js +82 -0
- package/components/Drawer/styles.module.css +0 -0
- package/components/EventListener/index.d.ts +20 -3
- package/components/EventListener/index.js +15 -22
- package/components/Gallery/index.d.ts +67 -0
- package/components/Gallery/index.js +173 -0
- package/components/Gallery/styles.module.css +33 -0
- package/components/Gallery/utils.d.ts +1 -0
- package/components/Image/index.d.ts +60 -0
- package/components/Image/index.js +99 -0
- package/components/Image/styles.module.css +0 -0
- package/components/IntersectionObserver/index.d.ts +48 -11
- package/components/IntersectionObserver/index.js +13 -22
- package/components/Paginator/index.d.ts +72 -0
- package/components/Paginator/index.js +116 -0
- package/components/Paginator/styles.module.css +9 -0
- package/components/ResizeObserver/index.d.ts +27 -0
- package/components/ResizeObserver/index.js +81 -0
- package/components/Scrllgngn/index.d.ts +123 -0
- package/components/Scrllgngn/index.js +175 -0
- package/components/Scrllgngn/styles.module.css +74 -0
- package/components/Sequencer/index.controlled.d.ts +78 -0
- package/components/Sequencer/index.d.ts +85 -0
- package/components/Sequencer/index.js +109 -0
- package/components/Sequencer/styles.module.css +0 -0
- package/components/ShadowRoot/index.d.ts +35 -0
- package/components/ShadowRoot/index.js +56 -0
- package/components/ShadowRoot/styles.module.css +0 -0
- package/components/Subtitles/index.d.ts +58 -0
- package/components/Subtitles/index.js +111 -0
- package/components/Subtitles/styles.module.css +0 -0
- package/components/Subtitles/types.d.ts +10 -0
- package/components/Subtitles/types.js +0 -0
- package/components/Subtitles/utils.d.ts +28 -0
- package/components/Theatre/index.d.ts +64 -0
- package/components/Theatre/index.js +97 -0
- package/components/Theatre/styles.module.css +0 -0
- package/components/Video/index.d.ts +119 -0
- package/components/Video/index.js +358 -0
- package/components/Video/styles.module.css +0 -0
- package/components/Video/utils.d.ts +10 -0
- package/components/_WIP_AudioQuote/index.d.ts +1 -0
- package/components/_WIP_AudioQuote/index.js +0 -0
- package/components/_WIP_Icon/index.d.ts +1 -0
- package/components/_WIP_Icon/index.js +0 -0
- package/components/index.d.ts +15 -1
- package/components/index.js +15 -1
- package/components/public-classnames.d.ts +14 -3
- package/components/utils/index.d.ts +1 -0
- package/components/utils/index.js +12 -0
- package/components/utils/types.d.ts +3 -0
- package/components/utils/types.js +0 -0
- package/node/@aws-s3/index.test.d.ts +1 -0
- package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +2 -2
- package/node/@aws-s3/storage/directory/copy-dir/index.js +3 -3
- package/node/@aws-s3/storage/directory/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/index.js +1 -1
- package/node/@aws-s3/storage/directory/list/index.d.ts +2 -2
- package/node/@aws-s3/storage/directory/list/index.js +1 -1
- package/node/@aws-s3/storage/directory/move-dir/index.d.ts +3 -3
- package/node/@aws-s3/storage/directory/move-dir/index.js +3 -3
- package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +2 -2
- package/node/@aws-s3/storage/directory/remove-dir/index.js +4 -4
- package/node/@aws-s3/storage/file/copy/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/download/index.d.ts +3 -3
- package/node/@aws-s3/storage/file/exists/index.d.ts +2 -2
- package/node/@aws-s3/storage/file/exists/index.js +1 -2
- package/node/@aws-s3/storage/file/index.d.ts +2 -2
- package/node/@aws-s3/storage/file/index.js +2 -2
- package/node/@aws-s3/storage/file/move/index.d.ts +2 -2
- package/node/@aws-s3/storage/file/remove/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/stat/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/upload/index.d.ts +2 -2
- package/node/@aws-s3/storage/index.d.ts +1 -1
- package/node/@aws-s3/storage/index.js +1 -1
- package/node/@express/@multer/index.d.ts +1 -1
- package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/index.js +1 -1
- package/node/@google-cloud/storage/directory/list/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/move-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/copy/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/download/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/exists/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/get-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/get-permissions/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/index.d.ts +6 -6
- package/node/@google-cloud/storage/file/index.js +6 -6
- package/node/@google-cloud/storage/file/move/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/remove/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +4 -4
- package/node/@google-cloud/storage/file/stat/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/stat/index.js +2 -2
- package/node/@google-cloud/storage/file/update-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/upload/index.d.ts +2 -2
- package/node/@google-cloud/storage/index.d.ts +1 -1
- package/node/@google-cloud/storage/index.js +1 -1
- package/node/cloud-storage/operations/copy-dir/index.d.ts +8 -8
- package/node/cloud-storage/operations/copy-dir/index.js +4 -4
- package/node/cloud-storage/operations/copy-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/copy-file/index.js +4 -4
- package/node/cloud-storage/operations/download-file/index.d.ts +9 -9
- package/node/cloud-storage/operations/download-file/index.js +4 -4
- package/node/cloud-storage/operations/exists-file/index.d.ts +6 -6
- package/node/cloud-storage/operations/exists-file/index.js +4 -4
- package/node/cloud-storage/operations/index.d.ts +1 -1
- package/node/cloud-storage/operations/index.js +1 -1
- package/node/cloud-storage/operations/list-dir/index.d.ts +6 -6
- package/node/cloud-storage/operations/list-dir/index.js +4 -4
- package/node/cloud-storage/operations/move-dir/index.d.ts +8 -8
- package/node/cloud-storage/operations/move-dir/index.js +4 -4
- package/node/cloud-storage/operations/move-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/move-file/index.js +4 -4
- package/node/cloud-storage/operations/remove-dir/index.d.ts +8 -8
- package/node/cloud-storage/operations/remove-dir/index.js +4 -4
- package/node/cloud-storage/operations/remove-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/remove-file/index.js +4 -4
- package/node/cloud-storage/operations/stat-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/stat-file/index.js +4 -4
- package/node/cloud-storage/operations/upload-file/index.d.ts +9 -9
- package/node/cloud-storage/operations/upload-file/index.js +4 -4
- package/node/encryption/index.d.ts +1 -1
- package/node/encryption/index.js +1 -1
- package/node/files/index.d.ts +1 -1
- package/node/files/index.js +1 -1
- package/node/files/read-write/index.js +1 -1
- package/node/files/subpaths/index.d.ts +3 -3
- package/node/files/subpaths/index.js +6 -6
- package/node/ftps/directory/copy-dir/index.d.ts +1 -1
- package/node/ftps/directory/copy-dir/index.js +1 -1
- package/node/ftps/directory/index.d.ts +2 -2
- package/node/ftps/directory/index.js +2 -2
- package/node/ftps/directory/list/index.d.ts +1 -1
- package/node/ftps/directory/move-dir/index.d.ts +1 -1
- package/node/ftps/directory/move-dir/index.js +1 -3
- package/node/ftps/directory/remove-dir/index.d.ts +2 -2
- package/node/ftps/file/copy/index.d.ts +1 -1
- package/node/ftps/file/copy/index.js +1 -1
- package/node/ftps/file/download/index.d.ts +2 -2
- package/node/ftps/file/exists/index.d.ts +2 -2
- package/node/ftps/file/exists/index.js +1 -1
- package/node/ftps/file/index.d.ts +1 -1
- package/node/ftps/file/index.js +1 -1
- package/node/ftps/file/move/index.d.ts +3 -3
- package/node/ftps/file/move/index.js +1 -1
- package/node/ftps/file/remove/index.d.ts +1 -1
- package/node/ftps/file/stat/index.d.ts +1 -1
- package/node/ftps/file/stat/index.js +2 -2
- package/node/ftps/file/upload/index.d.ts +2 -2
- package/node/images/format/index.d.ts +1 -1
- package/node/images/format/index.js +9 -9
- package/node/images/index.d.ts +1 -1
- package/node/images/index.js +1 -1
- package/node/images/metadata/index.d.ts +1 -1
- package/node/images/metadata/index.js +1 -1
- package/node/images/transform/index.d.ts +2 -2
- package/node/images/transform/index.js +26 -21
- package/node/images/transform/operations/blur/index.d.ts +1 -1
- package/node/images/transform/operations/brighten/index.d.ts +1 -1
- package/node/images/transform/operations/extend/index.d.ts +1 -1
- package/node/images/transform/operations/extract/index.d.ts +1 -1
- package/node/images/transform/operations/flatten/index.d.ts +1 -1
- package/node/images/transform/operations/flatten/index.js +1 -1
- package/node/images/transform/operations/flip/index.d.ts +1 -1
- package/node/images/transform/operations/flop/index.d.ts +1 -1
- package/node/images/transform/operations/hue/index.d.ts +1 -1
- package/node/images/transform/operations/index.d.ts +5 -5
- package/node/images/transform/operations/index.js +5 -5
- package/node/images/transform/operations/level/index.d.ts +1 -1
- package/node/images/transform/operations/lighten/index.d.ts +1 -1
- package/node/images/transform/operations/normalize/index.d.ts +1 -1
- package/node/images/transform/operations/overlay/index.js +1 -1
- package/node/images/transform/operations/resize/index.d.ts +1 -1
- package/node/images/transform/operations/rotate/index.d.ts +1 -1
- package/node/images/transform/operations/saturate/index.d.ts +1 -1
- package/node/index.d.ts +2 -2
- package/node/index.js +2 -2
- package/node/process/prompt-continue/index.js +1 -1
- package/node/process/spawner/index.d.ts +61 -10
- package/node/process/spawner/index.js +15 -13
- package/node/sftp/directory/copy-dir/index.d.ts +2 -1
- package/node/sftp/directory/copy-dir/index.js +2 -2
- package/node/sftp/directory/index.d.ts +1 -1
- package/node/sftp/directory/index.js +1 -1
- package/node/sftp/directory/list/index.d.ts +1 -1
- package/node/sftp/directory/move-dir/index.d.ts +1 -1
- package/node/sftp/directory/move-dir/index.js +2 -4
- package/node/sftp/directory/remove-dir/index.d.ts +2 -2
- package/node/sftp/file/copy/index.d.ts +2 -1
- package/node/sftp/file/copy/index.js +2 -2
- package/node/sftp/file/download/index.d.ts +3 -3
- package/node/sftp/file/exists/index.d.ts +1 -1
- package/node/sftp/file/index.d.ts +2 -2
- package/node/sftp/file/index.js +2 -2
- package/node/sftp/file/move/index.d.ts +3 -3
- package/node/sftp/file/move/index.js +3 -5
- package/node/sftp/file/remove/index.d.ts +1 -1
- package/node/sftp/file/remove/index.js +1 -1
- package/node/sftp/file/stat/index.d.ts +1 -1
- package/node/sftp/file/stat/index.js +1 -1
- package/node/sftp/file/upload/index.d.ts +3 -2
- package/node/sftp/file/upload/index.js +1 -1
- package/package.json +2265 -14
- package/components/Input/index.d.ts +0 -7
- package/components/Input/index.js +0 -29
- /package/components/{Input → Disclaimer}/styles.module.css +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/agnostic/random/random/index.ts
|
|
2
2
|
function random(bound1 = 1, bound2) {
|
|
3
3
|
const min = bound2 === void 0 ? 0 : bound1;
|
|
4
|
-
const max = bound2
|
|
4
|
+
const max = bound2 ?? bound1;
|
|
5
5
|
if (min === max || min > max) return void 0;
|
|
6
6
|
const range = max - min;
|
|
7
7
|
return Math.random() * range + min;
|
|
@@ -27,12 +27,12 @@ function sanitizeElement(element, options = defaultOptions) {
|
|
|
27
27
|
const normalizedTagName = tagName.toLowerCase().trim();
|
|
28
28
|
const tagIsInForbidden = forbiddenTags.includes("*") || forbiddenTags.includes(normalizedTagName);
|
|
29
29
|
if (tagIsInForbidden) {
|
|
30
|
-
if (verbose
|
|
30
|
+
if (verbose) console.warn(tagName, "tag is forbidden");
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
const tagIsInAllowed = allowedTags.includes("*") || allowedTags.includes(normalizedTagName);
|
|
34
34
|
if (!tagIsInAllowed) {
|
|
35
|
-
if (verbose
|
|
35
|
+
if (verbose) console.warn(tagName, "tag is not allowed");
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
const returnedElement = Window.get().document.createElement(tagName);
|
|
@@ -47,20 +47,20 @@ function sanitizeElement(element, options = defaultOptions) {
|
|
|
47
47
|
if (typeof nameTester === "string" && nameTester !== "*" && attributeName !== nameTester) return false;
|
|
48
48
|
if (typeof nameTester !== "string" && !nameTester.test(attributeName)) return false;
|
|
49
49
|
if (valTesters === void 0) {
|
|
50
|
-
if (verbose
|
|
50
|
+
if (verbose) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
|
|
51
51
|
return true;
|
|
52
52
|
}
|
|
53
53
|
if (valTesters.includes("*")) {
|
|
54
|
-
if (verbose
|
|
54
|
+
if (verbose) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
return valTesters.some((valTester) => {
|
|
58
58
|
if (typeof valTester === "string" && attributeValue === valTester) {
|
|
59
|
-
if (verbose
|
|
59
|
+
if (verbose) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
|
|
60
60
|
return true;
|
|
61
61
|
}
|
|
62
62
|
if (typeof valTester !== "string" && valTester.test(attributeValue)) {
|
|
63
|
-
if (verbose
|
|
63
|
+
if (verbose) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
66
|
return false;
|
|
@@ -93,7 +93,7 @@ function sanitizeElement(element, options = defaultOptions) {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
if (!isInAllowed) {
|
|
96
|
-
if (verbose
|
|
96
|
+
if (verbose) console.warn(...latestNotAllowedReason);
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
99
|
return true;
|
|
@@ -26,12 +26,8 @@ export type SanitizeHtmlOptions = {
|
|
|
26
26
|
keepComments?: boolean;
|
|
27
27
|
allowedTags?: string[];
|
|
28
28
|
forbiddenTags?: string[];
|
|
29
|
-
allowedAttributes?:
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
forbiddenAttributes?: {
|
|
33
|
-
[tagName: string]: AttributeNameValPair[];
|
|
34
|
-
};
|
|
29
|
+
allowedAttributes?: Record<string, AttributeNameValPair[]>;
|
|
30
|
+
forbiddenAttributes?: Record<string, AttributeNameValPair[]>;
|
|
35
31
|
depth?: number;
|
|
36
32
|
verbose?: boolean;
|
|
37
33
|
};
|
|
@@ -43,25 +43,25 @@ export declare function charFromB36CharCode(b36CharCode: B36CharCode): string;
|
|
|
43
43
|
* @param string - Input string.
|
|
44
44
|
* @returns Array of character codes.
|
|
45
45
|
*/
|
|
46
|
-
export declare function toCharCodes(string: string):
|
|
46
|
+
export declare function toCharCodes(string: string): CharCode[];
|
|
47
47
|
/**
|
|
48
48
|
* Converts a string into an array of base-36 encoded character codes.
|
|
49
49
|
* @param string - Input string.
|
|
50
50
|
* @returns Array of base-36 character codes.
|
|
51
51
|
*/
|
|
52
|
-
export declare function toB36CharCodes(string: string):
|
|
52
|
+
export declare function toB36CharCodes(string: string): B36CharCode[];
|
|
53
53
|
/**
|
|
54
54
|
* Converts an array of Unicode character codes back to a string.
|
|
55
55
|
* @param charCodes - Array of character codes.
|
|
56
56
|
* @returns Reconstructed string.
|
|
57
57
|
*/
|
|
58
|
-
export declare function fromCharCodes(charCodes:
|
|
58
|
+
export declare function fromCharCodes(charCodes: CharCode[]): string;
|
|
59
59
|
/**
|
|
60
60
|
* Converts an array of base-36 encoded character codes back to a string.
|
|
61
61
|
* @param b36CharCodes - Array of base-36 character codes.
|
|
62
62
|
* @returns Reconstructed string.
|
|
63
63
|
*/
|
|
64
|
-
export declare function fromB36CharCodes(b36CharCodes:
|
|
64
|
+
export declare function fromB36CharCodes(b36CharCodes: B36CharCode[]): string;
|
|
65
65
|
/**
|
|
66
66
|
* Serializes an array of character codes (Unicode or base-36) into a string.
|
|
67
67
|
* @param charCodes - Array of character codes to serialize.
|
|
@@ -73,7 +73,7 @@ export declare function serialize(charCodes: Array<CharCode | B36CharCode>): str
|
|
|
73
73
|
* @param serializedCharCodes - Serialized string.
|
|
74
74
|
* @returns Array of Unicode character codes.
|
|
75
75
|
*/
|
|
76
|
-
export declare function deserialize(serializedCharCodes: string):
|
|
76
|
+
export declare function deserialize(serializedCharCodes: string): CharCode[];
|
|
77
77
|
/**
|
|
78
78
|
* Deserializes a string of base-36 character codes and reconstructs the original string.
|
|
79
79
|
* @param serializedCharCodes - Serialized string.
|
|
@@ -35,10 +35,10 @@ function toB36CharCodes(string) {
|
|
|
35
35
|
return chars.map(charToB36CharCode);
|
|
36
36
|
}
|
|
37
37
|
function fromCharCodes(charCodes) {
|
|
38
|
-
return charCodes.map(charFromCharCode).map((char) => char
|
|
38
|
+
return charCodes.map(charFromCharCode).map((char) => char ?? "\0").join("");
|
|
39
39
|
}
|
|
40
40
|
function fromB36CharCodes(b36CharCodes) {
|
|
41
|
-
return b36CharCodes.map(charFromB36CharCode).map((char) => char
|
|
41
|
+
return b36CharCodes.map(charFromB36CharCode).map((char) => char ?? "\0").join("");
|
|
42
42
|
}
|
|
43
43
|
function serialize(charCodes) {
|
|
44
44
|
return charCodes.map((c) => typeof c === "string" ? c : charCodeToB36(c)).join(",");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * as charCodes from './char-codes/index.js'
|
|
2
1
|
export * as matches from './matches/index.js'
|
|
2
|
+
export * as normalizeIndent from './normalize-indent/index.js'
|
|
3
|
+
export * as charCodes from './char-codes/index.js'
|
|
4
|
+
export * as parseTable from './parse-table/index.js'
|
|
3
5
|
export * as replaceAll from './replace-all/index.js'
|
|
4
6
|
export * as toAlphanum from './to-alphanum/index.js'
|
|
5
7
|
export * as trim from './trim/index.js'
|
|
6
|
-
export * as normalizeIndent from './normalize-indent/index.js'
|
|
7
|
-
export * as parseTable from './parse-table/index.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * as charCodes from './char-codes/index.js'
|
|
2
1
|
export * as matches from './matches/index.js'
|
|
2
|
+
export * as normalizeIndent from './normalize-indent/index.js'
|
|
3
|
+
export * as charCodes from './char-codes/index.js'
|
|
4
|
+
export * as parseTable from './parse-table/index.js'
|
|
3
5
|
export * as replaceAll from './replace-all/index.js'
|
|
4
6
|
export * as toAlphanum from './to-alphanum/index.js'
|
|
5
7
|
export * as trim from './trim/index.js'
|
|
6
|
-
export * as normalizeIndent from './normalize-indent/index.js'
|
|
7
|
-
export * as parseTable from './parse-table/index.js'
|
|
@@ -17,7 +17,7 @@ export declare function matches(input: string, matcher: Matcher): boolean;
|
|
|
17
17
|
* @param matchers - A matcher or array of matchers.
|
|
18
18
|
* @returns `true` if the input matches at least one matcher, otherwise `false`.
|
|
19
19
|
*/
|
|
20
|
-
export declare function matchesSome(input: string, matchers: Matcher |
|
|
20
|
+
export declare function matchesSome(input: string, matchers: Matcher | Matcher[]): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Checks whether a string matches every matcher in a list (or a single matcher).
|
|
23
23
|
*
|
|
@@ -25,4 +25,4 @@ export declare function matchesSome(input: string, matchers: Matcher | Array<Mat
|
|
|
25
25
|
* @param matchers - A matcher or array of matchers.
|
|
26
26
|
* @returns `true` if the input matches all matchers, otherwise `false`.
|
|
27
27
|
*/
|
|
28
|
-
export declare function matchesEvery(input: string, matchers: Matcher |
|
|
28
|
+
export declare function matchesEvery(input: string, matchers: Matcher | Matcher[]): boolean;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// src/agnostic/time/dates/format-date/index.ts
|
|
2
2
|
function formatDate(date, format, locale = "en") {
|
|
3
|
-
|
|
4
|
-
new Intl.DateTimeFormat(locale);
|
|
5
|
-
} catch {
|
|
3
|
+
if (Intl.DateTimeFormat.supportedLocalesOf(locale).length === 0) {
|
|
6
4
|
locale = "en";
|
|
7
5
|
}
|
|
8
6
|
const day = date.getDate();
|
|
@@ -13,23 +11,39 @@ function formatDate(date, format, locale = "en") {
|
|
|
13
11
|
const minutes = date.getMinutes();
|
|
14
12
|
const seconds = date.getSeconds();
|
|
15
13
|
const isPM = hours >= 12;
|
|
16
|
-
const shortDateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const shortDateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(
|
|
15
|
+
locale,
|
|
16
|
+
{ weekday: "short" }
|
|
17
|
+
).format(new Date(2023, 0, i + 1)));
|
|
18
|
+
const dateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(
|
|
19
|
+
locale,
|
|
20
|
+
{ weekday: "long" }
|
|
21
|
+
).format(new Date(2023, 0, i + 1)));
|
|
22
|
+
const shortMonthNames = [...Array(12)].map((_, i) => new Intl.DateTimeFormat(
|
|
23
|
+
locale,
|
|
24
|
+
{ month: "short" }
|
|
25
|
+
).format(new Date(2023, i, 1)));
|
|
26
|
+
const monthNames = [...Array(12)].map((_, i) => new Intl.DateTimeFormat(
|
|
27
|
+
locale,
|
|
28
|
+
{ month: "long" }
|
|
29
|
+
).format(new Date(2023, i, 1)));
|
|
20
30
|
const replacements = {
|
|
21
31
|
"DD": () => String(day).padStart(2, "0"),
|
|
22
32
|
"D": () => String(day),
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
23
34
|
"dd": () => dateNames[dayOfWeek],
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
24
36
|
"d": () => shortDateNames[dayOfWeek],
|
|
25
37
|
"MM": () => String(month + 1).padStart(2, "0"),
|
|
26
38
|
"M": () => String(month + 1),
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
27
40
|
"MMMM": () => monthNames[month],
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
42
|
"MMM": () => shortMonthNames[month],
|
|
29
43
|
"YYYY": () => String(year),
|
|
30
44
|
"YY": () => String(year).slice(-2),
|
|
31
|
-
"hh": () => String(hours % 12
|
|
32
|
-
"h": () => String(hours % 12
|
|
45
|
+
"hh": () => String(hours % 12 !== 0 ? hours % 12 : 12).padStart(2, "0"),
|
|
46
|
+
"h": () => String(hours % 12 !== 0 ? hours % 12 : 12),
|
|
33
47
|
"HH": () => String(hours).padStart(2, "0"),
|
|
34
48
|
"H": () => String(hours),
|
|
35
49
|
"mm": () => String(minutes).padStart(2, "0"),
|
|
@@ -19,21 +19,42 @@ export declare class Duration {
|
|
|
19
19
|
* @param type - The unit of the duration, either long or short form.
|
|
20
20
|
*/
|
|
21
21
|
constructor(value: number, type: DurationType | DurationTypeShort);
|
|
22
|
-
toMilliseconds
|
|
23
|
-
toMs()
|
|
22
|
+
toMilliseconds(): number;
|
|
23
|
+
toMs: () => number;
|
|
24
24
|
toSeconds(): number;
|
|
25
|
+
toS: () => number;
|
|
26
|
+
toSec: () => number;
|
|
25
27
|
toMinutes(): number;
|
|
28
|
+
toM: () => number;
|
|
29
|
+
toMin: () => number;
|
|
26
30
|
toHours(): number;
|
|
31
|
+
toH: () => number;
|
|
27
32
|
toDays(): number;
|
|
33
|
+
toD: () => number;
|
|
28
34
|
toWeeks(): number;
|
|
35
|
+
toW: () => number;
|
|
29
36
|
toMonths(): number;
|
|
37
|
+
toMth: () => number;
|
|
30
38
|
toYear(): number;
|
|
39
|
+
toY: () => number;
|
|
40
|
+
toYr: () => number;
|
|
31
41
|
}
|
|
32
42
|
export declare function milliseconds(value: number): Duration;
|
|
43
|
+
export declare const ms: typeof milliseconds;
|
|
33
44
|
export declare function seconds(value: number): Duration;
|
|
45
|
+
export declare const s: typeof seconds;
|
|
46
|
+
export declare const sec: typeof seconds;
|
|
34
47
|
export declare function minutes(value: number): Duration;
|
|
48
|
+
export declare const m: typeof minutes;
|
|
49
|
+
export declare const min: typeof minutes;
|
|
35
50
|
export declare function hours(value: number): Duration;
|
|
51
|
+
export declare const h: typeof hours;
|
|
36
52
|
export declare function days(value: number): Duration;
|
|
53
|
+
export declare const d: typeof days;
|
|
37
54
|
export declare function weeks(value: number): Duration;
|
|
55
|
+
export declare const w: typeof weeks;
|
|
38
56
|
export declare function months(value: number): Duration;
|
|
57
|
+
export declare const mth: typeof months;
|
|
39
58
|
export declare function years(value: number): Duration;
|
|
59
|
+
export declare const y: typeof years;
|
|
60
|
+
export declare const yr: typeof years;
|
|
@@ -10,7 +10,6 @@ var Duration = class {
|
|
|
10
10
|
*/
|
|
11
11
|
constructor(value, type) {
|
|
12
12
|
this.toMilliseconds = this.toMilliseconds.bind(this);
|
|
13
|
-
this.toMs = this.toMs.bind(this);
|
|
14
13
|
this.toSeconds = this.toSeconds.bind(this);
|
|
15
14
|
this.toMinutes = this.toMinutes.bind(this);
|
|
16
15
|
this.toHours = this.toHours.bind(this);
|
|
@@ -39,8 +38,8 @@ var Duration = class {
|
|
|
39
38
|
this.type = "milliseconds";
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
// [WIP] why only toMs and no other shorthands ?
|
|
42
|
+
toMilliseconds() {
|
|
44
43
|
if (this.type === "milliseconds") return this.value;
|
|
45
44
|
if (this.type === "seconds") return this.value * 1e3;
|
|
46
45
|
if (this.type === "minutes") return this.value * 1e3 * 60;
|
|
@@ -51,60 +50,93 @@ var Duration = class {
|
|
|
51
50
|
if (this.type === "years") return this.value * 1e3 * 60 * 60 * 24 * 365;
|
|
52
51
|
return this.value;
|
|
53
52
|
}
|
|
53
|
+
toMs = this.toMilliseconds.bind(this);
|
|
54
54
|
toSeconds() {
|
|
55
55
|
return this.toMs() / 1e3;
|
|
56
56
|
}
|
|
57
|
+
toS = this.toSeconds.bind(this);
|
|
58
|
+
toSec = this.toSeconds.bind(this);
|
|
57
59
|
toMinutes() {
|
|
58
60
|
return this.toMs() / (1e3 * 60);
|
|
59
61
|
}
|
|
62
|
+
toM = this.toMinutes.bind(this);
|
|
63
|
+
toMin = this.toMinutes.bind(this);
|
|
60
64
|
toHours() {
|
|
61
65
|
return this.toMs() / (1e3 * 60 * 60);
|
|
62
66
|
}
|
|
67
|
+
toH = this.toHours.bind(this);
|
|
63
68
|
toDays() {
|
|
64
69
|
return this.toMs() / (1e3 * 60 * 60 * 24);
|
|
65
70
|
}
|
|
71
|
+
toD = this.toDays.bind(this);
|
|
66
72
|
toWeeks() {
|
|
67
73
|
return this.toMs() / (1e3 * 60 * 60 * 24 * 7);
|
|
68
74
|
}
|
|
75
|
+
toW = this.toWeeks.bind(this);
|
|
69
76
|
toMonths() {
|
|
70
77
|
return this.toMs() / (1e3 * 60 * 60 * 24 * 30);
|
|
71
78
|
}
|
|
79
|
+
toMth = this.toMonths.bind(this);
|
|
72
80
|
toYear() {
|
|
73
81
|
return this.toMs() / (1e3 * 60 * 60 * 24 * 365);
|
|
74
82
|
}
|
|
83
|
+
toY = this.toYear.bind(this);
|
|
84
|
+
toYr = this.toYear.bind(this);
|
|
75
85
|
};
|
|
76
86
|
function milliseconds(value) {
|
|
77
87
|
return new Duration(value, "milliseconds");
|
|
78
88
|
}
|
|
89
|
+
var ms = milliseconds;
|
|
79
90
|
function seconds(value) {
|
|
80
91
|
return new Duration(value, "seconds");
|
|
81
92
|
}
|
|
93
|
+
var s = seconds;
|
|
94
|
+
var sec = seconds;
|
|
82
95
|
function minutes(value) {
|
|
83
96
|
return new Duration(value, "minutes");
|
|
84
97
|
}
|
|
98
|
+
var m = minutes;
|
|
99
|
+
var min = minutes;
|
|
85
100
|
function hours(value) {
|
|
86
101
|
return new Duration(value, "hours");
|
|
87
102
|
}
|
|
103
|
+
var h = hours;
|
|
88
104
|
function days(value) {
|
|
89
105
|
return new Duration(value, "days");
|
|
90
106
|
}
|
|
107
|
+
var d = days;
|
|
91
108
|
function weeks(value) {
|
|
92
109
|
return new Duration(value, "weeks");
|
|
93
110
|
}
|
|
111
|
+
var w = weeks;
|
|
94
112
|
function months(value) {
|
|
95
113
|
return new Duration(value, "months");
|
|
96
114
|
}
|
|
115
|
+
var mth = months;
|
|
97
116
|
function years(value) {
|
|
98
117
|
return new Duration(value, "years");
|
|
99
118
|
}
|
|
119
|
+
var y = years;
|
|
120
|
+
var yr = years;
|
|
100
121
|
export {
|
|
101
122
|
Duration,
|
|
123
|
+
d,
|
|
102
124
|
days,
|
|
125
|
+
h,
|
|
103
126
|
hours,
|
|
127
|
+
m,
|
|
104
128
|
milliseconds,
|
|
129
|
+
min,
|
|
105
130
|
minutes,
|
|
106
131
|
months,
|
|
132
|
+
ms,
|
|
133
|
+
mth,
|
|
134
|
+
s,
|
|
135
|
+
sec,
|
|
107
136
|
seconds,
|
|
137
|
+
w,
|
|
108
138
|
weeks,
|
|
109
|
-
|
|
139
|
+
y,
|
|
140
|
+
years,
|
|
141
|
+
yr
|
|
110
142
|
};
|
package/agnostic/time/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as duration from './duration/index.js'
|
|
2
|
+
export * as dates from './dates/index.js'
|
|
3
|
+
export * as wait from './wait/index.js'
|
|
2
4
|
export * as timeout from './timeout/index.js'
|
|
3
5
|
export * as transitions from './transitions/index.js'
|
|
4
|
-
export * as wait from './wait/index.js'
|
|
5
|
-
export * as dates from './dates/index.js'
|
package/agnostic/time/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as duration from './duration/index.js'
|
|
2
|
+
export * as dates from './dates/index.js'
|
|
3
|
+
export * as wait from './wait/index.js'
|
|
2
4
|
export * as timeout from './timeout/index.js'
|
|
3
5
|
export * as transitions from './transitions/index.js'
|
|
4
|
-
export * as wait from './wait/index.js'
|
|
5
|
-
export * as dates from './dates/index.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/agnostic/time/timeout/index.ts
|
|
2
|
-
function timeout(timeoutMs, callback) {
|
|
2
|
+
async function timeout(timeoutMs, callback) {
|
|
3
3
|
let hasRejected = false;
|
|
4
|
-
return new Promise(async (resolve, reject) => {
|
|
4
|
+
return await new Promise(async (resolve, reject) => {
|
|
5
5
|
const rejectTimeout = setTimeout(() => {
|
|
6
6
|
reject(false);
|
|
7
7
|
hasRejected = true;
|
|
@@ -54,16 +54,16 @@ export type EasingFunction = (progress: number) => number;
|
|
|
54
54
|
*/
|
|
55
55
|
export type EasingDictionary = Record<string, EasingFunction>;
|
|
56
56
|
/**
|
|
57
|
-
* Performs a numeric transition from 0 to `
|
|
57
|
+
* Performs a numeric transition from 0 to `steps` over `durationMs` milliseconds.
|
|
58
58
|
* Invokes a callback at each step with the eased value and timestamp.
|
|
59
59
|
*
|
|
60
|
-
* @param
|
|
60
|
+
* @param steps - The number of steps or increments for the transition.
|
|
61
61
|
* @param durationMs - Total duration of the transition in milliseconds.
|
|
62
62
|
* @param callbackOrEase - Either a callback function for each step or a predefined easing name.
|
|
63
63
|
* @param callback - Optional callback if `callbackOrEase` is an easing name.
|
|
64
64
|
* @returns A promise that resolves when the transition is complete.
|
|
65
65
|
*/
|
|
66
|
-
export declare function transition(
|
|
66
|
+
export declare function transition(steps: number, durationMs: number, callbackOrEase: Ease | Callback, callback?: Callback): Promise<void>;
|
|
67
67
|
/**
|
|
68
68
|
* Predefined easing functions used internally by transitions.
|
|
69
69
|
*/
|
|
@@ -34,18 +34,18 @@ var Ease = /* @__PURE__ */ ((Ease2) => {
|
|
|
34
34
|
Ease2["EASE_IN_OUT_BOUNCE"] = "ease-in-out-bounce";
|
|
35
35
|
return Ease2;
|
|
36
36
|
})(Ease || {});
|
|
37
|
-
async function transition(
|
|
37
|
+
async function transition(steps, durationMs, callbackOrEase, callback) {
|
|
38
38
|
const ease = typeof callbackOrEase === "string" ? callbackOrEase : "linear" /* LINEAR */;
|
|
39
39
|
const easing = easings[ease];
|
|
40
40
|
if (easing === void 0) return;
|
|
41
41
|
const actualCallback = callback ?? (typeof callbackOrEase === "function" ? callbackOrEase : void 0);
|
|
42
42
|
if (actualCallback === void 0) return;
|
|
43
43
|
const start = Date.now();
|
|
44
|
-
const timeTable = new Array(
|
|
45
|
-
const progression = (step + 1) /
|
|
44
|
+
const timeTable = new Array(steps).fill(null).map((_, step) => {
|
|
45
|
+
const progression = (step + 1) / steps;
|
|
46
46
|
const eased = easing(progression);
|
|
47
47
|
const time = start + eased * durationMs;
|
|
48
|
-
return { time, step: eased *
|
|
48
|
+
return { time, step: eased * steps };
|
|
49
49
|
});
|
|
50
50
|
for (const { time, step } of timeTable) {
|
|
51
51
|
const now = Date.now();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Returns a promise that resolves after the specified duration in milliseconds.
|
|
3
3
|
*
|
|
4
4
|
* @param durationMs - Time to wait in milliseconds.
|
|
5
|
-
* @returns A promise that resolves to `
|
|
5
|
+
* @returns A promise that resolves to `void` after the delay.
|
|
6
6
|
*/
|
|
7
|
-
export declare function wait(durationMs: number): Promise<
|
|
7
|
+
export declare function wait(durationMs: number): Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactNode, type PropsWithChildren, type FunctionComponent } from 'react';
|
|
2
|
+
import type { WithClassName } from '../utils/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Disclaimer component.
|
|
5
|
+
*
|
|
6
|
+
* @property content - Content displayed inside the disclaimer panel.
|
|
7
|
+
* @property togglerContent - Content rendered inside the dismiss toggler.
|
|
8
|
+
* If not provided, the toggler is not rendered.
|
|
9
|
+
* @property isOn - Controls the visibility state. When defined, the component
|
|
10
|
+
* behaves as a controlled component.
|
|
11
|
+
* @property defaultIsOn - Default visibility state for uncontrolled mode.
|
|
12
|
+
* @property stateHandlers - Callbacks invoked after state changes.
|
|
13
|
+
* @property stateHandlers.toggled - Callback invoked after the disclaimer state changes.
|
|
14
|
+
* @property actionHandlers - Callbacks invoked before actions are committed.
|
|
15
|
+
* @property actionHandlers.dismissClick - Callback invoked before the disclaimer is dismissed.
|
|
16
|
+
* @property className - Optional additional class name(s) applied to the root element.
|
|
17
|
+
* @property children - Additional content rendered below the disclaimer panel.
|
|
18
|
+
*/
|
|
19
|
+
export type Props = PropsWithChildren<WithClassName<{
|
|
20
|
+
content?: ReactNode;
|
|
21
|
+
togglerContent?: ReactNode;
|
|
22
|
+
isOn?: boolean;
|
|
23
|
+
defaultIsOn?: boolean;
|
|
24
|
+
stateHandlers?: {
|
|
25
|
+
toggled?: (isOn: boolean) => void;
|
|
26
|
+
};
|
|
27
|
+
actionHandlers?: {
|
|
28
|
+
dismissClick?: (prevIsOn: boolean) => void;
|
|
29
|
+
};
|
|
30
|
+
}>>;
|
|
31
|
+
/**
|
|
32
|
+
* Component that displays a dismissible disclaimer panel.
|
|
33
|
+
*
|
|
34
|
+
* Supports both controlled (`isOn` provided) and uncontrolled modes.
|
|
35
|
+
*
|
|
36
|
+
* @param props - Component properties.
|
|
37
|
+
* @see {@link Props}
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* - In controlled mode, visibility is driven by `isOn` and internal state
|
|
41
|
+
* does not toggle automatically.
|
|
42
|
+
* - In uncontrolled mode, the component manages its own visibility state.
|
|
43
|
+
* - Applies `on` and `off` modifier classes depending on visibility state.
|
|
44
|
+
*/
|
|
45
|
+
export declare const Disclaimer: FunctionComponent<Props>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/components/Disclaimer/index.tsx
|
|
2
|
+
import {
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
useRef
|
|
6
|
+
} from "react";
|
|
7
|
+
import { clss } from "../../agnostic/css/clss/index.js";
|
|
8
|
+
import { mergeClassNames } from "../utils/index.js";
|
|
9
|
+
import { disclaimer as publicClassName } from "../public-classnames.js";
|
|
10
|
+
import cssModule from "./styles.module.css";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var Disclaimer = ({
|
|
13
|
+
content,
|
|
14
|
+
togglerContent,
|
|
15
|
+
isOn: isOnProp,
|
|
16
|
+
defaultIsOn: defaultIsOnProp,
|
|
17
|
+
stateHandlers,
|
|
18
|
+
actionHandlers,
|
|
19
|
+
children,
|
|
20
|
+
className
|
|
21
|
+
}) => {
|
|
22
|
+
const [internalIsOn, setInternalIsOn] = useState(isOnProp ?? defaultIsOnProp ?? true);
|
|
23
|
+
const isOn = isOnProp ?? internalIsOn;
|
|
24
|
+
const pIsOn = useRef(isOn);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (pIsOn.current === isOn) return;
|
|
27
|
+
stateHandlers?.toggled?.(isOn);
|
|
28
|
+
pIsOn.current = isOn;
|
|
29
|
+
}, [isOn]);
|
|
30
|
+
const handleDismissClick = () => {
|
|
31
|
+
actionHandlers?.dismissClick?.(isOn);
|
|
32
|
+
if (isOnProp !== void 0) return;
|
|
33
|
+
setInternalIsOn(false);
|
|
34
|
+
};
|
|
35
|
+
const c = clss(publicClassName, { cssModule });
|
|
36
|
+
const rootClss = mergeClassNames(
|
|
37
|
+
c(null, {
|
|
38
|
+
on: isOn,
|
|
39
|
+
off: !isOn
|
|
40
|
+
}),
|
|
41
|
+
className
|
|
42
|
+
);
|
|
43
|
+
const panelClss = c("panel");
|
|
44
|
+
const contentClss = c("content");
|
|
45
|
+
const btnClss = c("toggler");
|
|
46
|
+
const sensitiveClss = c("sensitive");
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className: rootClss, children: [
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: panelClss, children: [
|
|
49
|
+
content !== void 0 && /* @__PURE__ */ jsx(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: contentClss,
|
|
53
|
+
children: content
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
togglerContent !== void 0 && /* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: btnClss,
|
|
60
|
+
onClick: handleDismissClick,
|
|
61
|
+
children: togglerContent
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx("div", { className: sensitiveClss, children })
|
|
66
|
+
] });
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
Disclaimer
|
|
70
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type PropsWithChildren, type FunctionComponent, type ReactNode } from 'react';
|
|
2
|
+
import type { WithClassName } from '../utils/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Drawer component.
|
|
5
|
+
*
|
|
6
|
+
* @property openerContent - Content rendered inside the opener control.
|
|
7
|
+
* @property closerContent - Content rendered inside the closer control.
|
|
8
|
+
* @property initialIsOpened - Initial open state in uncontrolled mode.
|
|
9
|
+
* Ignored when `isOpened` is provided.
|
|
10
|
+
* @property isOpened - Controlled open state. When defined, the component
|
|
11
|
+
* behaves as a controlled component and internal state is ignored.
|
|
12
|
+
* @property stateHandlers - Callbacks invoked after the state changes
|
|
13
|
+
* @property stateHandlers.toggled - Callbacks invoked after the isOpened state has changed
|
|
14
|
+
* @property className - Additional class name(s) applied to the root element.
|
|
15
|
+
* @property children - Drawer content.
|
|
16
|
+
*/
|
|
17
|
+
export type Props = PropsWithChildren<WithClassName<{
|
|
18
|
+
openerContent?: ReactNode;
|
|
19
|
+
closerContent?: ReactNode;
|
|
20
|
+
initialIsOpened?: boolean;
|
|
21
|
+
isOpened?: boolean;
|
|
22
|
+
stateHandlers?: {
|
|
23
|
+
toggled?: (isOpen: boolean) => void;
|
|
24
|
+
};
|
|
25
|
+
}>>;
|
|
26
|
+
/**
|
|
27
|
+
* Drawer component with optional controlled and uncontrolled behavior.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* - In controlled mode (`isOpened` defined), visibility is fully driven by the prop.
|
|
31
|
+
* - In uncontrolled mode, internal state is initialized from `initialIsOpened`.
|
|
32
|
+
* - The component measures its content using `ResizeObserverComponent`
|
|
33
|
+
* and exposes the dimensions:
|
|
34
|
+
* - As CSS custom properties:
|
|
35
|
+
* --{prefix}-content-height
|
|
36
|
+
* --{prefix}-content-height-px
|
|
37
|
+
* --{prefix}-content-width
|
|
38
|
+
* --{prefix}-content-width-px
|
|
39
|
+
* - As `data-content-width` and `data-content-height` attributes.
|
|
40
|
+
*
|
|
41
|
+
* CSS modifier classes:
|
|
42
|
+
* - `opened` when open
|
|
43
|
+
* - `closed` when closed
|
|
44
|
+
*/
|
|
45
|
+
export declare const Drawer: FunctionComponent<Props>;
|