@design-edito/tools 0.2.15 → 0.2.17
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.js +8 -8
- package/agnostic/arrays/random-pick/index.js +4 -4
- package/agnostic/colors/channels/index.d.ts +5 -0
- package/agnostic/colors/channels/index.js +18 -0
- package/agnostic/colors/contrast/index.d.ts +2 -0
- package/agnostic/colors/contrast/index.js +13 -0
- package/agnostic/colors/convert/index.d.ts +20 -0
- package/agnostic/colors/convert/index.js +45 -0
- package/agnostic/colors/distance/index.d.ts +2 -0
- package/agnostic/colors/distance/index.js +12 -0
- package/agnostic/colors/grayscale/index.d.ts +2 -0
- package/agnostic/colors/grayscale/index.js +12 -0
- package/agnostic/colors/index.d.ts +14 -16
- package/agnostic/colors/index.js +95 -27
- package/agnostic/colors/invert/index.d.ts +2 -0
- package/agnostic/colors/invert/index.js +12 -0
- package/agnostic/colors/lerp/index.d.ts +2 -0
- package/agnostic/colors/lerp/index.js +12 -0
- package/agnostic/colors/luminance/index.d.ts +2 -0
- package/agnostic/colors/luminance/index.js +12 -0
- package/agnostic/colors/palette/index.d.ts +2 -0
- package/agnostic/colors/palette/index.js +14 -0
- package/agnostic/colors/rotate/index.d.ts +2 -0
- package/agnostic/colors/rotate/index.js +13 -0
- package/agnostic/colors/tidy/index.d.ts +2 -0
- package/agnostic/colors/tidy/index.js +11 -0
- package/agnostic/colors/typechecks/index.d.ts +11 -0
- package/agnostic/colors/typechecks/index.js +26 -0
- package/agnostic/colors/types.d.ts +82 -0
- package/agnostic/css/index.js +12 -12
- package/agnostic/css/styles-set/index.js +6 -6
- package/agnostic/html/hyper-json/cast/index.js +7 -7
- package/agnostic/html/hyper-json/index.js +8 -8
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +7 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +7 -7
- package/agnostic/html/hyper-json/tree/index.js +7 -7
- package/agnostic/html/hyper-json/utils/index.js +7 -7
- package/agnostic/html/index.js +21 -21
- package/agnostic/html/sanitize/index.js +4 -4
- package/agnostic/html/selector-to-element/index.js +4 -4
- package/agnostic/html/string-to-nodes/index.js +5 -5
- package/agnostic/index.d.ts +1 -1
- package/agnostic/misc/crossenv/index.js +2 -2
- package/agnostic/misc/index.js +27 -27
- package/agnostic/misc/logs/index.js +2 -2
- package/agnostic/misc/lorem-ipsum/index.js +11 -11
- package/agnostic/numbers/index.js +9 -9
- package/agnostic/objects/index.js +8 -8
- package/agnostic/random/index.js +2 -2
- package/agnostic/strings/index.js +7 -7
- package/agnostic/time/index.js +6 -6
- package/chunks/chunk-2EHYEUX4.js +21 -0
- package/chunks/chunk-5LK2YLTK.js +21 -0
- package/chunks/chunk-65NTXENV.js +157 -0
- package/chunks/chunk-ALMK24GK.js +0 -0
- package/chunks/{chunk-B446JIN3.js → chunk-AQBJ6HNB.js} +1 -1
- package/chunks/chunk-BKIF2ELV.js +47 -0
- package/chunks/chunk-D7SXHHU3.js +47 -0
- package/chunks/chunk-GUBFCOBT.js +98 -0
- package/chunks/{chunk-XDITZ5QN.js → chunk-HONCMQHQ.js} +2 -2
- package/chunks/{chunk-YIZODJC7.js → chunk-IAOZM4EN.js} +5 -5
- package/chunks/chunk-IDXUS2IO.js +296 -0
- package/chunks/chunk-ISUDTAMN.js +101 -0
- package/chunks/{chunk-GVQVGFAA.js → chunk-J4WGYUFY.js} +4 -4
- package/chunks/{chunk-Q6DUKZU6.js → chunk-JJ7DN7NN.js} +7 -7
- package/chunks/{chunk-EDJ3TVNV.js → chunk-KDOMQ4LM.js} +15 -6
- package/chunks/{chunk-TSZAQ3RQ.js → chunk-L5VJAZVW.js} +90 -91
- package/chunks/chunk-MN4FVOU2.js +28 -0
- package/chunks/{chunk-IOJTC6CN.js → chunk-O7VEAOGY.js} +22 -22
- package/chunks/{chunk-2M33FCDG.js → chunk-O7VFJHQX.js} +11 -5
- package/chunks/chunk-P4YT4RBG.js +51 -0
- package/chunks/{chunk-2UAVBQI5.js → chunk-QJXJT5JS.js} +4 -4
- package/chunks/{chunk-FQ4UTWMP.js → chunk-QTA7ZEVX.js} +3 -1
- package/chunks/chunk-QW34TQCS.js +48 -0
- package/chunks/{chunk-HMAK6VAF.js → chunk-RBCZWVQH.js} +11 -5
- package/chunks/{chunk-IWDIKDYR.js → chunk-RBH5MYJ7.js} +17 -17
- package/chunks/{chunk-AI6AGF4I.js → chunk-S7637BQZ.js} +8 -5
- package/chunks/{chunk-SA2IY5LN.js → chunk-SKBOSWM2.js} +1 -1
- package/chunks/{chunk-CYUEPBUN.js → chunk-STW5RKR7.js} +2 -2
- package/chunks/{chunk-CHUOCTRP.js → chunk-TIER4TF4.js} +1 -1
- package/chunks/chunk-UG5EMKGN.js +265 -0
- package/chunks/chunk-VA67YLZL.js +26 -0
- package/chunks/chunk-XAYMIITK.js +103 -0
- package/chunks/{chunk-JWF5EKM2.js → chunk-XB3EGDBI.js} +1 -1
- package/chunks/chunk-YZVZKBVJ.js +631 -0
- package/chunks/{chunk-36CTYZYA.js → chunk-ZBBU2P4D.js} +2 -2
- package/chunks/chunk-ZJ63OCMA.js +207 -0
- package/node/@aws-s3/index.js +9 -9
- package/node/@aws-s3/storage/directory/index.js +7 -7
- package/node/@aws-s3/storage/file/index.js +13 -13
- package/node/@aws-s3/storage/index.js +11 -11
- package/node/@google-cloud/index.js +14 -14
- package/node/@google-cloud/storage/bucket/index.js +4 -4
- package/node/@google-cloud/storage/directory/index.js +7 -7
- package/node/@google-cloud/storage/file/index.js +18 -18
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +2 -2
- package/node/@google-cloud/storage/index.js +16 -16
- package/node/cloud-storage/index.js +41 -41
- package/node/cloud-storage/operations/copy-dir/index.js +2 -2
- package/node/cloud-storage/operations/copy-file/index.js +2 -2
- package/node/cloud-storage/operations/download-file/index.js +2 -2
- package/node/cloud-storage/operations/exists-file/index.js +2 -2
- package/node/cloud-storage/operations/index.js +53 -53
- package/node/cloud-storage/operations/list-dir/index.js +2 -2
- package/node/cloud-storage/operations/move-dir/index.js +2 -2
- package/node/cloud-storage/operations/move-file/index.js +2 -2
- package/node/cloud-storage/operations/remove-dir/index.js +2 -2
- package/node/cloud-storage/operations/remove-file/index.js +2 -2
- package/node/cloud-storage/operations/stat-file/index.js +2 -2
- package/node/cloud-storage/operations/upload-file/index.js +2 -2
- package/node/encryption/index.js +3 -3
- package/node/ftps/directory/index.js +7 -7
- package/node/ftps/file/index.js +13 -13
- package/node/ftps/index.js +10 -10
- package/node/images/create/index.d.ts +3 -0
- package/node/images/create/index.js +23 -0
- package/node/images/format/index.d.ts +17 -51
- package/node/images/format/index.js +30 -4
- package/node/images/index.d.ts +4 -2
- package/node/images/index.js +41 -21
- package/node/images/metadata/index.d.ts +3 -0
- package/node/images/metadata/index.js +23 -0
- package/node/images/transform/index.d.ts +2 -97
- package/node/images/transform/index.js +27 -16
- package/node/images/transform/operations/blur/index.d.ts +1 -3
- package/node/images/transform/operations/brighten/index.d.ts +1 -3
- package/node/images/transform/operations/extend/index.d.ts +1 -8
- package/node/images/transform/operations/extend/index.js +17 -2
- package/node/images/transform/operations/extract/index.d.ts +1 -6
- package/node/images/transform/operations/flatten/index.d.ts +1 -3
- package/node/images/transform/operations/flatten/index.js +17 -2
- package/node/images/transform/operations/hue/index.d.ts +1 -3
- package/node/images/transform/operations/level/index.d.ts +1 -4
- package/node/images/transform/operations/lighten/index.d.ts +1 -3
- package/node/images/transform/operations/normalize/index.d.ts +1 -4
- package/node/images/transform/operations/overlay/index.d.ts +5 -0
- package/node/images/transform/operations/overlay/index.js +27 -0
- package/node/images/transform/operations/resize/index.d.ts +1 -11
- package/node/images/transform/operations/resize/index.js +17 -2
- package/node/images/transform/operations/rotate/index.d.ts +1 -4
- package/node/images/transform/operations/rotate/index.js +17 -2
- package/node/images/transform/operations/saturate/index.d.ts +1 -3
- package/node/images/transform/operations/saturate/index.js +1 -1
- package/node/images/types.d.ts +252 -0
- package/node/images/utils/index.d.ts +7 -0
- package/node/images/utils/index.js +28 -0
- package/node/sftp/directory/index.js +7 -7
- package/node/sftp/file/index.js +13 -13
- package/node/sftp/index.js +10 -10
- package/package.json +1 -1
- package/agnostic/colors/complement-color/index.d.ts +0 -1
- package/agnostic/colors/complement-color/index.js +0 -7
- package/agnostic/colors/hex-to-rgb/index.d.ts +0 -1
- package/agnostic/colors/hex-to-rgb/index.js +0 -7
- package/agnostic/colors/hsl-to-rgb/index.d.ts +0 -1
- package/agnostic/colors/hsl-to-rgb/index.js +0 -7
- package/agnostic/colors/lighten-color/index.d.ts +0 -2
- package/agnostic/colors/lighten-color/index.js +0 -11
- package/agnostic/colors/rgb-to-hex/index.d.ts +0 -1
- package/agnostic/colors/rgb-to-hex/index.js +0 -7
- package/agnostic/colors/rgb-to-hsl/index.d.ts +0 -1
- package/agnostic/colors/rgb-to-hsl/index.js +0 -7
- package/agnostic/colors/saturate-color/index.d.ts +0 -2
- package/agnostic/colors/saturate-color/index.js +0 -11
- package/chunks/chunk-2POD3TAX.js +0 -11
- package/chunks/chunk-2TJCB6IM.js +0 -12
- package/chunks/chunk-7EDDWSWS.js +0 -123
- package/chunks/chunk-FAXNZG5C.js +0 -10
- package/chunks/chunk-IFQA5PWI.js +0 -112
- package/chunks/chunk-MB7HWF22.js +0 -23
- package/chunks/chunk-MFYNJMVM.js +0 -18
- package/chunks/chunk-NYVARFI7.js +0 -20
- package/chunks/chunk-QLC3A6PC.js +0 -17
- package/chunks/chunk-U57Q62IN.js +0 -23
- package/chunks/chunk-YVLJKJV2.js +0 -17
- package/node/images/get-metadata/index.d.ts +0 -4
- package/node/images/get-metadata/index.js +0 -7
- package/node/images/transform/operations/composite/index.d.ts +0 -7
- package/node/images/transform/operations/composite/index.js +0 -12
- package/node/images/transform/utils/index.d.ts +0 -2
- package/node/images/transform/utils/index.js +0 -8
- package/chunks/{chunk-LAVXHKKR.js → chunk-2DW5MV3U.js} +12 -12
- package/chunks/{chunk-QCMBG5LN.js → chunk-7SZXDQVJ.js} +16 -16
- package/chunks/{chunk-74CFPDKM.js → chunk-A7K5DUP7.js} +6 -6
- package/chunks/{chunk-DEQWCMAL.js → chunk-ASCJDM27.js} +12 -12
- package/chunks/{chunk-646R6BQZ.js → chunk-CGITTQIW.js} +3 -3
- package/chunks/{chunk-7KSMK42F.js → chunk-CNMP2GU4.js} +6 -6
- package/chunks/{chunk-EOTOFHUR.js → chunk-D7PZ7633.js} +3 -3
- package/chunks/{chunk-UFKH5WD2.js → chunk-FR5H2OCV.js} +3 -3
- package/chunks/{chunk-FS6LRTDK.js → chunk-HX5PHI2P.js} +3 -3
- package/chunks/{chunk-CA3UPHYO.js → chunk-JNQPNZTB.js} +3 -3
- package/chunks/{chunk-G5RRNREY.js → chunk-LSZVKXDZ.js} +3 -3
- package/chunks/{chunk-MJQF3YZO.js → chunk-QN3UAKIU.js} +3 -3
- package/chunks/{chunk-DPQRXSZH.js → chunk-RXBMGIPJ.js} +3 -3
- package/chunks/{chunk-OVG5RGI3.js → chunk-S32K7POB.js} +4 -4
- package/chunks/{chunk-Y4THX4AN.js → chunk-TFZOOTCF.js} +3 -3
- package/chunks/{chunk-UXEKCYL7.js → chunk-UEAMPAHK.js} +3 -3
- package/chunks/{chunk-24ZUWYIR.js → chunk-UX2O74SG.js} +3 -3
- package/chunks/{chunk-AIC5YAJU.js → chunk-X5F6XGEP.js} +6 -6
- package/chunks/{chunk-JSW6R3ZH.js → chunk-X5VXP4GS.js} +12 -12
- package/chunks/{chunk-OA7Y2A5T.js → chunk-XNWEMAIP.js} +3 -3
- package/chunks/{chunk-UK4HNSEJ.js → chunk-YVWQXQTE.js} +3 -3
- package/chunks/{chunk-4OK2UH4M.js → chunk-ZBAKY6DB.js} +6 -6
- package/chunks/{chunk-6NLNUGBI.js → chunk-ZQY2MR66.js} +3 -3
- package/chunks/{chunk-NOLQR5RW.js → chunk-ZUQEHFGL.js} +3 -3
|
@@ -3,19 +3,12 @@ import {
|
|
|
3
3
|
matchesEvery,
|
|
4
4
|
matchesSome
|
|
5
5
|
} from "../../chunks/chunk-R3AWQXMY.js";
|
|
6
|
-
import {
|
|
7
|
-
CharCodes
|
|
8
|
-
} from "../../chunks/chunk-34U4HX4V.js";
|
|
9
|
-
import {
|
|
10
|
-
normalizeIndent
|
|
11
|
-
} from "../../chunks/chunk-JQXNEJAP.js";
|
|
12
6
|
import {
|
|
13
7
|
replaceAll
|
|
14
8
|
} from "../../chunks/chunk-ZTDVUXPR.js";
|
|
15
9
|
import {
|
|
16
10
|
parseTable
|
|
17
11
|
} from "../../chunks/chunk-A3CDUWGR.js";
|
|
18
|
-
import "../../chunks/chunk-JMU5PDBD.js";
|
|
19
12
|
import {
|
|
20
13
|
toAlphanum
|
|
21
14
|
} from "../../chunks/chunk-COVPTTAD.js";
|
|
@@ -23,6 +16,13 @@ import {
|
|
|
23
16
|
trimEnd,
|
|
24
17
|
trimStart
|
|
25
18
|
} from "../../chunks/chunk-6XL25OZX.js";
|
|
19
|
+
import "../../chunks/chunk-JMU5PDBD.js";
|
|
20
|
+
import {
|
|
21
|
+
CharCodes
|
|
22
|
+
} from "../../chunks/chunk-34U4HX4V.js";
|
|
23
|
+
import {
|
|
24
|
+
normalizeIndent
|
|
25
|
+
} from "../../chunks/chunk-JQXNEJAP.js";
|
|
26
26
|
import "../../chunks/chunk-WSFCRVEQ.js";
|
|
27
27
|
|
|
28
28
|
// src/agnostic/strings/index.ts
|
package/agnostic/time/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
timeout
|
|
3
|
-
} from "../../chunks/chunk-Z7ZDDBV5.js";
|
|
4
|
-
import {
|
|
5
|
-
Transitions
|
|
6
|
-
} from "../../chunks/chunk-ENMBK6H7.js";
|
|
7
1
|
import {
|
|
8
2
|
Dates
|
|
9
3
|
} from "../../chunks/chunk-FZOU4OAW.js";
|
|
@@ -11,6 +5,12 @@ import "../../chunks/chunk-YQWZ3EP2.js";
|
|
|
11
5
|
import {
|
|
12
6
|
Duration
|
|
13
7
|
} from "../../chunks/chunk-6NYUQXJT.js";
|
|
8
|
+
import {
|
|
9
|
+
timeout
|
|
10
|
+
} from "../../chunks/chunk-Z7ZDDBV5.js";
|
|
11
|
+
import {
|
|
12
|
+
Transitions
|
|
13
|
+
} from "../../chunks/chunk-ENMBK6H7.js";
|
|
14
14
|
import {
|
|
15
15
|
wait
|
|
16
16
|
} from "../../chunks/chunk-4CIS3R7T.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toCreateOptions
|
|
3
|
+
} from "./chunk-BKIF2ELV.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-WSFCRVEQ.js";
|
|
7
|
+
|
|
8
|
+
// src/node/images/create/index.ts
|
|
9
|
+
var create_exports = {};
|
|
10
|
+
__export(create_exports, {
|
|
11
|
+
create: () => create
|
|
12
|
+
});
|
|
13
|
+
import sharp from "sharp";
|
|
14
|
+
async function create(options) {
|
|
15
|
+
return sharp({ create: toCreateOptions(options) });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
create,
|
|
20
|
+
create_exports
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toSharpInstance
|
|
3
|
+
} from "./chunk-BKIF2ELV.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-WSFCRVEQ.js";
|
|
7
|
+
|
|
8
|
+
// src/node/images/metadata/index.ts
|
|
9
|
+
var metadata_exports = {};
|
|
10
|
+
__export(metadata_exports, {
|
|
11
|
+
metadata: () => metadata
|
|
12
|
+
});
|
|
13
|
+
async function metadata(imageInput) {
|
|
14
|
+
const sharpInstance = await toSharpInstance(imageInput);
|
|
15
|
+
return sharpInstance.metadata();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
metadata,
|
|
20
|
+
metadata_exports
|
|
21
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
viaCmyk,
|
|
3
|
+
viaHsb,
|
|
4
|
+
viaHsl,
|
|
5
|
+
viaLab,
|
|
6
|
+
viaLch,
|
|
7
|
+
viaRgb,
|
|
8
|
+
viaXyz
|
|
9
|
+
} from "./chunk-YZVZKBVJ.js";
|
|
10
|
+
|
|
11
|
+
// src/agnostic/colors/grayscale/index.ts
|
|
12
|
+
function avgGrayscaleRgb(rgb) {
|
|
13
|
+
const { r, g, b } = rgb;
|
|
14
|
+
const avg = (r + g + b) / 3;
|
|
15
|
+
return { ...rgb, r: avg, g: avg, b: avg };
|
|
16
|
+
}
|
|
17
|
+
function weightedAvgGrayscaleRgb(rgb) {
|
|
18
|
+
const { r, g, b } = rgb;
|
|
19
|
+
const avg = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
20
|
+
return { ...rgb, r: avg, g: avg, b: avg };
|
|
21
|
+
}
|
|
22
|
+
function minChannelGrayscaleRgb(rgb) {
|
|
23
|
+
const { r, g, b } = rgb;
|
|
24
|
+
const min = Math.min(r, g, b);
|
|
25
|
+
return { ...rgb, r: min, g: min, b: min };
|
|
26
|
+
}
|
|
27
|
+
function maxChannelGrayscaleRgb(rgb) {
|
|
28
|
+
const { r, g, b } = rgb;
|
|
29
|
+
const max = Math.max(r, g, b);
|
|
30
|
+
return { ...rgb, r: max, g: max, b: max };
|
|
31
|
+
}
|
|
32
|
+
function grayscaleRgbVia(rgb, channel) {
|
|
33
|
+
const { r, g, b } = rgb;
|
|
34
|
+
switch (channel) {
|
|
35
|
+
case "red":
|
|
36
|
+
return { ...rgb, r, g: r, b: r };
|
|
37
|
+
case "green":
|
|
38
|
+
return { ...rgb, r: g, g, b: g };
|
|
39
|
+
case "blue":
|
|
40
|
+
return { ...rgb, r: b, g: b, b };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function avgGrayscaleCmyk(cmyk) {
|
|
44
|
+
const { c, m, y, k } = cmyk;
|
|
45
|
+
const avg = (c + m + y + k) / 4;
|
|
46
|
+
return { ...cmyk, c: avg, m: avg, y: avg, k: avg };
|
|
47
|
+
}
|
|
48
|
+
function avgNoBlackGrayscaleCmyk(cmyk) {
|
|
49
|
+
const { c, m, y } = cmyk;
|
|
50
|
+
const avg = (c + m + y) / 3;
|
|
51
|
+
return { ...cmyk, c: avg, m: avg, y: avg, k: avg };
|
|
52
|
+
}
|
|
53
|
+
function minChannelGrayscaleCmyk(cmyk) {
|
|
54
|
+
const { c, m, y, k } = cmyk;
|
|
55
|
+
const min = Math.min(c, m, y, k);
|
|
56
|
+
return { ...cmyk, c: min, m: min, y: min, k: min };
|
|
57
|
+
}
|
|
58
|
+
function minNoBlackChannelGrayscaleCmyk(cmyk) {
|
|
59
|
+
const { c, m, y } = cmyk;
|
|
60
|
+
const min = Math.min(c, m, y);
|
|
61
|
+
return { ...cmyk, c: min, m: min, y: min, k: min };
|
|
62
|
+
}
|
|
63
|
+
function maxChannelGrayscaleCmyk(cmyk) {
|
|
64
|
+
const { c, m, y, k } = cmyk;
|
|
65
|
+
const max = Math.max(c, m, y, k);
|
|
66
|
+
return { ...cmyk, c: max, m: max, y: max, k: max };
|
|
67
|
+
}
|
|
68
|
+
function maxNoBlackChannelGrayscaleCmyk(cmyk) {
|
|
69
|
+
const { c, m, y } = cmyk;
|
|
70
|
+
const max = Math.max(c, m, y);
|
|
71
|
+
return { ...cmyk, c: max, m: max, y: max, k: max };
|
|
72
|
+
}
|
|
73
|
+
function grayscaleCmykVia(cmyk, channel) {
|
|
74
|
+
const { c, m, y, k } = cmyk;
|
|
75
|
+
switch (channel) {
|
|
76
|
+
case "cyan":
|
|
77
|
+
return { ...cmyk, c, m: c, y: c, k: c };
|
|
78
|
+
case "magenta":
|
|
79
|
+
return { ...cmyk, c: m, m, y: m, k: m };
|
|
80
|
+
case "yellow":
|
|
81
|
+
return { ...cmyk, c: y, m: y, y, k: y };
|
|
82
|
+
case "black":
|
|
83
|
+
return { ...cmyk, c: k, m: k, y: k, k };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function perceptualGrayscaleCmyk(cmyk) {
|
|
87
|
+
return { ...cmyk, c: 0, m: 0, y: 0 };
|
|
88
|
+
}
|
|
89
|
+
function grayscaleHsl(hsl) {
|
|
90
|
+
return { ...hsl, s: 0 };
|
|
91
|
+
}
|
|
92
|
+
function grayscaleHsb(hsb) {
|
|
93
|
+
return { ...hsb, s: 0 };
|
|
94
|
+
}
|
|
95
|
+
function grayscaleXyz(xyz) {
|
|
96
|
+
return { ...xyz, x: xyz.y, z: xyz.y };
|
|
97
|
+
}
|
|
98
|
+
function grayscaleLab(lab) {
|
|
99
|
+
return { ...lab, a: 0, b: 0 };
|
|
100
|
+
}
|
|
101
|
+
function grayscaleLch(lch) {
|
|
102
|
+
return { ...lch, c: 0 };
|
|
103
|
+
}
|
|
104
|
+
function grayscale(color, method = "lab") {
|
|
105
|
+
switch (method) {
|
|
106
|
+
case "rgb-avg":
|
|
107
|
+
return viaRgb(color, avgGrayscaleRgb);
|
|
108
|
+
case "rgb-weighted-avg":
|
|
109
|
+
return viaRgb(color, weightedAvgGrayscaleRgb);
|
|
110
|
+
case "rgb-min-channel":
|
|
111
|
+
return viaRgb(color, minChannelGrayscaleRgb);
|
|
112
|
+
case "rgb-max-channel":
|
|
113
|
+
return viaRgb(color, maxChannelGrayscaleRgb);
|
|
114
|
+
case "rgb-via-red":
|
|
115
|
+
return viaRgb(color, (rgb) => grayscaleRgbVia(rgb, "red"));
|
|
116
|
+
case "rgb-via-green":
|
|
117
|
+
return viaRgb(color, (rgb) => grayscaleRgbVia(rgb, "green"));
|
|
118
|
+
case "rgb-via-blue":
|
|
119
|
+
return viaRgb(color, (rgb) => grayscaleRgbVia(rgb, "blue"));
|
|
120
|
+
case "cmyk-avg":
|
|
121
|
+
return viaCmyk(color, avgGrayscaleCmyk);
|
|
122
|
+
case "cmyk-no-black-avg":
|
|
123
|
+
return viaCmyk(color, avgNoBlackGrayscaleCmyk);
|
|
124
|
+
case "cmyk-min-channel":
|
|
125
|
+
return viaCmyk(color, minChannelGrayscaleCmyk);
|
|
126
|
+
case "cmyk-min-no-black-channel":
|
|
127
|
+
return viaCmyk(color, minNoBlackChannelGrayscaleCmyk);
|
|
128
|
+
case "cmyk-max-channel":
|
|
129
|
+
return viaCmyk(color, maxChannelGrayscaleCmyk);
|
|
130
|
+
case "cmyk-max-no-black-channel":
|
|
131
|
+
return viaCmyk(color, maxNoBlackChannelGrayscaleCmyk);
|
|
132
|
+
case "cmyk-via-cyan":
|
|
133
|
+
return viaCmyk(color, (cmyk) => grayscaleCmykVia(cmyk, "cyan"));
|
|
134
|
+
case "cmyk-via-magenta":
|
|
135
|
+
return viaCmyk(color, (cmyk) => grayscaleCmykVia(cmyk, "magenta"));
|
|
136
|
+
case "cmyk-via-yellow":
|
|
137
|
+
return viaCmyk(color, (cmyk) => grayscaleCmykVia(cmyk, "yellow"));
|
|
138
|
+
case "cmyk-via-black":
|
|
139
|
+
return viaCmyk(color, (cmyk) => grayscaleCmykVia(cmyk, "black"));
|
|
140
|
+
case "cmyk-perceptual":
|
|
141
|
+
return viaCmyk(color, perceptualGrayscaleCmyk);
|
|
142
|
+
case "hsl":
|
|
143
|
+
return viaHsl(color, grayscaleHsl);
|
|
144
|
+
case "hsb":
|
|
145
|
+
return viaHsb(color, grayscaleHsb);
|
|
146
|
+
case "xyz":
|
|
147
|
+
return viaXyz(color, grayscaleXyz);
|
|
148
|
+
case "lab":
|
|
149
|
+
return viaLab(color, grayscaleLab);
|
|
150
|
+
case "lch":
|
|
151
|
+
return viaLch(color, grayscaleLch);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
grayscale
|
|
157
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tidy,
|
|
3
|
+
toRgb
|
|
4
|
+
} from "./chunk-YZVZKBVJ.js";
|
|
5
|
+
import {
|
|
6
|
+
isNonNullObject
|
|
7
|
+
} from "./chunk-HQLRJ7XW.js";
|
|
8
|
+
|
|
9
|
+
// src/node/images/utils/index.ts
|
|
10
|
+
import { readFile } from "node:fs/promises";
|
|
11
|
+
import sharp from "sharp";
|
|
12
|
+
function toSharpColor(color) {
|
|
13
|
+
const rgb = tidy(toRgb(color));
|
|
14
|
+
return {
|
|
15
|
+
r: rgb.r,
|
|
16
|
+
g: rgb.g,
|
|
17
|
+
b: rgb.b,
|
|
18
|
+
alpha: rgb.a
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function isDuckTypedSharpInstance(obj) {
|
|
22
|
+
if (!isNonNullObject(obj)) return false;
|
|
23
|
+
return "avif" in obj && "clone" in obj && "gif" in obj && "heif" in obj && "jpeg" in obj && "heif" in obj && "metadata" in obj && "png" in obj && "resize" in obj && "tiff" in obj && "webp" in obj && typeof obj.avif === "function" && typeof obj.clone === "function" && typeof obj.gif === "function" && typeof obj.heif === "function" && typeof obj.jpeg === "function" && typeof obj.heif === "function" && typeof obj.metadata === "function" && typeof obj.png === "function" && typeof obj.resize === "function" && typeof obj.tiff === "function" && typeof obj.webp === "function";
|
|
24
|
+
}
|
|
25
|
+
function toCreateOptions(options) {
|
|
26
|
+
return {
|
|
27
|
+
width: options.width ?? 100,
|
|
28
|
+
height: options.height ?? 100,
|
|
29
|
+
channels: options.channels ?? 4,
|
|
30
|
+
background: options.background !== void 0 ? toSharpColor(options.background) : toSharpColor("white"),
|
|
31
|
+
noise: options.noise !== void 0 ? { ...options.noise, type: "gaussian" } : void 0,
|
|
32
|
+
pageHeight: options.pageHeight
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function toSharpInstance(imageLike, clone = false) {
|
|
36
|
+
if (typeof imageLike === "string") return sharp(await readFile(imageLike));
|
|
37
|
+
if (Buffer.isBuffer(imageLike)) return sharp(imageLike);
|
|
38
|
+
if (isDuckTypedSharpInstance(imageLike)) return clone ? imageLike.clone() : imageLike;
|
|
39
|
+
return sharp({ create: toCreateOptions(imageLike) });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
toSharpColor,
|
|
44
|
+
isDuckTypedSharpInstance,
|
|
45
|
+
toCreateOptions,
|
|
46
|
+
toSharpInstance
|
|
47
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
viaLab,
|
|
3
|
+
viaLch,
|
|
4
|
+
viaRgb
|
|
5
|
+
} from "./chunk-YZVZKBVJ.js";
|
|
6
|
+
import {
|
|
7
|
+
absoluteModulo
|
|
8
|
+
} from "./chunk-DNIOWD7K.js";
|
|
9
|
+
|
|
10
|
+
// src/agnostic/colors/invert/index.ts
|
|
11
|
+
function invertRgb(color) {
|
|
12
|
+
return viaRgb(color, (rgb) => ({
|
|
13
|
+
...rgb,
|
|
14
|
+
r: 255 - rgb.r,
|
|
15
|
+
g: 255 - rgb.g,
|
|
16
|
+
b: 255 - rgb.b
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
function invertLab(color) {
|
|
20
|
+
return viaLab(color, (lab) => ({
|
|
21
|
+
...lab,
|
|
22
|
+
l: 100 - lab.l,
|
|
23
|
+
a: -1 * lab.a,
|
|
24
|
+
b: -1 * lab.b
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
function invertLch(color) {
|
|
28
|
+
return viaLch(color, (lch) => ({
|
|
29
|
+
...lch,
|
|
30
|
+
l: 100 - lch.l,
|
|
31
|
+
h: absoluteModulo(lch.h + 180, 360)
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
function invert(color, method = "lch") {
|
|
35
|
+
switch (method) {
|
|
36
|
+
case "rgb":
|
|
37
|
+
return invertRgb(color);
|
|
38
|
+
case "lab":
|
|
39
|
+
return invertLab(color);
|
|
40
|
+
case "lch":
|
|
41
|
+
return invertLch(color);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
invert
|
|
47
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toHsb,
|
|
3
|
+
toHsl,
|
|
4
|
+
toLab,
|
|
5
|
+
toLch,
|
|
6
|
+
toRgb,
|
|
7
|
+
toXyz,
|
|
8
|
+
viaHsb,
|
|
9
|
+
viaHsl,
|
|
10
|
+
viaLab,
|
|
11
|
+
viaLch,
|
|
12
|
+
viaRgb,
|
|
13
|
+
viaXyz
|
|
14
|
+
} from "./chunk-YZVZKBVJ.js";
|
|
15
|
+
|
|
16
|
+
// src/agnostic/colors/lerp/index.ts
|
|
17
|
+
function lerpRgb(rgb1, rgb2, amount) {
|
|
18
|
+
const r = rgb1.r + (rgb2.r - rgb1.r) * amount;
|
|
19
|
+
const g = rgb1.g + (rgb2.g - rgb1.g) * amount;
|
|
20
|
+
const b = rgb1.b + (rgb2.b - rgb1.b) * amount;
|
|
21
|
+
const a = (rgb1.a ?? 1) + ((rgb2.a ?? 1) - (rgb1.a ?? 1)) * amount;
|
|
22
|
+
return { r, g, b, a };
|
|
23
|
+
}
|
|
24
|
+
function lerpLab(lab1, lab2, amount) {
|
|
25
|
+
const l = lab1.l + (lab2.l - lab1.l) * amount;
|
|
26
|
+
const a = lab1.a + (lab2.a - lab1.a) * amount;
|
|
27
|
+
const b = lab1.b + (lab2.b - lab1.b) * amount;
|
|
28
|
+
const al = (lab1.al ?? 1) + ((lab2.al ?? 1) - (lab1.al ?? 1)) * amount;
|
|
29
|
+
return { l, a, b, al };
|
|
30
|
+
}
|
|
31
|
+
function lerpLch(lch1, lch2, amount) {
|
|
32
|
+
const l = lch1.l + (lch2.l - lch1.l) * amount;
|
|
33
|
+
const c = lch1.c + (lch2.c - lch1.c) * amount;
|
|
34
|
+
let hDiff = lch2.h - lch1.h;
|
|
35
|
+
if (hDiff > 180) hDiff -= 360;
|
|
36
|
+
if (hDiff < -180) hDiff += 360;
|
|
37
|
+
const h = (lch1.h + hDiff * amount + 360) % 360;
|
|
38
|
+
const a = (lch1.a ?? 1) + ((lch2.a ?? 1) - (lch1.a ?? 1)) * amount;
|
|
39
|
+
return { l, c, h, a };
|
|
40
|
+
}
|
|
41
|
+
function lerpHsl(hsl1, hsl2, amount) {
|
|
42
|
+
const l = hsl1.l + (hsl2.l - hsl1.l) * amount;
|
|
43
|
+
const s = hsl1.s + (hsl2.s - hsl1.s) * amount;
|
|
44
|
+
let hDiff = hsl2.h - hsl1.h;
|
|
45
|
+
if (hDiff > 180) hDiff -= 360;
|
|
46
|
+
if (hDiff < -180) hDiff += 360;
|
|
47
|
+
const h = (hsl1.h + hDiff * amount + 360) % 360;
|
|
48
|
+
const a = (hsl1.a ?? 1) + ((hsl2.a ?? 1) - (hsl1.a ?? 1)) * amount;
|
|
49
|
+
return { h, s, l, a };
|
|
50
|
+
}
|
|
51
|
+
function lerpHsb(hsb1, hsb2, amount) {
|
|
52
|
+
const b = hsb1.b + (hsb2.b - hsb1.b) * amount;
|
|
53
|
+
const s = hsb1.s + (hsb2.s - hsb1.s) * amount;
|
|
54
|
+
let hDiff = hsb2.h - hsb1.h;
|
|
55
|
+
if (hDiff > 180) hDiff -= 360;
|
|
56
|
+
if (hDiff < -180) hDiff += 360;
|
|
57
|
+
const h = (hsb1.h + hDiff * amount + 360) % 360;
|
|
58
|
+
const a = (hsb1.a ?? 1) + ((hsb2.a ?? 1) - (hsb1.a ?? 1)) * amount;
|
|
59
|
+
return { h, s, b, a };
|
|
60
|
+
}
|
|
61
|
+
function lerpLinearRgb(rgb1, rgb2, amount) {
|
|
62
|
+
const linearChannel = (v) => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
63
|
+
const delinearize = (v) => v <= 31308e-7 ? v * 12.92 : 1.055 * Math.pow(v, 1 / 2.4) - 0.055;
|
|
64
|
+
const r = delinearize(linearChannel(rgb1.r) + (linearChannel(rgb2.r) - linearChannel(rgb1.r)) * amount);
|
|
65
|
+
const g = delinearize(linearChannel(rgb1.g) + (linearChannel(rgb2.g) - linearChannel(rgb1.g)) * amount);
|
|
66
|
+
const b = delinearize(linearChannel(rgb1.b) + (linearChannel(rgb2.b) - linearChannel(rgb1.b)) * amount);
|
|
67
|
+
const a = (rgb1.a ?? 1) + ((rgb2.a ?? 1) - (rgb1.a ?? 1)) * amount;
|
|
68
|
+
return { r, g, b, a };
|
|
69
|
+
}
|
|
70
|
+
function lerpXyz(xyz1, xyz2, amount) {
|
|
71
|
+
const x = xyz1.x + (xyz2.x - xyz1.x) * amount;
|
|
72
|
+
const y = xyz1.y + (xyz2.y - xyz1.y) * amount;
|
|
73
|
+
const z = xyz1.z + (xyz2.z - xyz1.z) * amount;
|
|
74
|
+
const a = (xyz1.a ?? 1) + ((xyz2.a ?? 1) - (xyz1.a ?? 1)) * amount;
|
|
75
|
+
return { x, y, z, a };
|
|
76
|
+
}
|
|
77
|
+
function lerp(c1, c2, amount, method = "rgb") {
|
|
78
|
+
switch (method) {
|
|
79
|
+
case "rgb":
|
|
80
|
+
return viaRgb(c1, (rgb1) => lerpRgb(rgb1, toRgb(c2), amount));
|
|
81
|
+
case "lab":
|
|
82
|
+
return viaLab(c1, (lab1) => lerpLab(lab1, toLab(c2), amount));
|
|
83
|
+
case "lch":
|
|
84
|
+
return viaLch(c1, (lch1) => lerpLch(lch1, toLch(c2), amount));
|
|
85
|
+
case "hsl":
|
|
86
|
+
return viaHsl(c1, (hsl1) => lerpHsl(hsl1, toHsl(c2), amount));
|
|
87
|
+
case "hsb":
|
|
88
|
+
return viaHsb(c1, (hsb1) => lerpHsb(hsb1, toHsb(c2), amount));
|
|
89
|
+
case "rgb-linear":
|
|
90
|
+
return viaRgb(c1, (rgb1) => lerpLinearRgb(rgb1, toRgb(c2), amount));
|
|
91
|
+
case "xyz":
|
|
92
|
+
return viaXyz(c1, (xyz1) => lerpXyz(xyz1, toXyz(c2), amount));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
lerp
|
|
98
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
file_exports
|
|
3
|
-
} from "./chunk-IWDIKDYR.js";
|
|
4
1
|
import {
|
|
5
2
|
bucket_exports
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UEAMPAHK.js";
|
|
4
|
+
import {
|
|
5
|
+
file_exports
|
|
6
|
+
} from "./chunk-RBH5MYJ7.js";
|
|
7
7
|
import {
|
|
8
8
|
directory_exports
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-X5F6XGEP.js";
|
|
10
10
|
import {
|
|
11
11
|
__export
|
|
12
12
|
} from "./chunk-WSFCRVEQ.js";
|