@design-edito/tools 0.1.52 → 0.1.53
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/find-duplicates/index.js +1 -0
- package/agnostic/arrays/index.js +7 -6
- package/agnostic/arrays/is-array-of/index.js +1 -0
- package/agnostic/arrays/make/index.js +1 -0
- package/agnostic/arrays/random-pick/index.js +5 -4
- package/agnostic/arrays/shuffle/index.js +1 -0
- package/agnostic/booleans/index.js +1 -0
- package/agnostic/booleans/is-falsy/index.js +1 -0
- package/agnostic/css/bem/index.js +3 -2
- package/agnostic/css/generate-nice-color/index.js +1 -0
- package/agnostic/css/index.js +14 -13
- package/agnostic/css/is-valid-css-class-name/index.js +1 -0
- package/agnostic/css/styles-set/index.js +5 -4
- package/agnostic/errors/index.js +3 -2
- package/agnostic/errors/register/index.js +1 -0
- package/agnostic/errors/unknown-to-string/index.js +1 -0
- package/agnostic/html/get-node-ancestors/index.js +1 -0
- package/agnostic/html/get-position-inside-parent/index.js +1 -0
- package/agnostic/html/hyper-json/cast/index.js +6 -5
- package/agnostic/html/hyper-json/index.js +7 -6
- package/agnostic/html/hyper-json/method/index.js +1 -0
- package/agnostic/html/hyper-json/serialize/index.js +1 -0
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/index.js +1 -0
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +1 -0
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +1 -0
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +1 -0
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +6 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +6 -5
- package/agnostic/html/hyper-json/transformer/index.js +1 -0
- package/agnostic/html/hyper-json/tree/index.js +6 -5
- package/agnostic/html/hyper-json/types/index.js +1 -0
- package/agnostic/html/hyper-json/utils/index.js +6 -5
- package/agnostic/html/index.js +20 -19
- package/agnostic/html/insert-node/index.js +1 -0
- package/agnostic/html/placeholders/index.js +1 -0
- package/agnostic/html/replace-in-element/index.js +1 -0
- package/agnostic/html/sanitize/index.js +5 -4
- package/agnostic/html/selector-to-element/index.js +5 -4
- package/agnostic/html/string-to-nodes/index.js +6 -5
- package/agnostic/misc/assert/index.js +4 -3
- package/agnostic/misc/cast/index.js +1 -0
- package/agnostic/misc/crawler/index.js +1 -0
- package/agnostic/misc/crossenv/detect-runtime/index.js +1 -0
- package/agnostic/misc/crossenv/index.js +1 -0
- package/agnostic/misc/crossenv/types/index.js +1 -0
- package/agnostic/misc/crossenv/window/index.js +1 -0
- package/agnostic/misc/data-size/index.js +1 -0
- package/agnostic/misc/elo/index.js +2 -0
- package/agnostic/misc/get-current-downlink/index.js +1 -0
- package/agnostic/misc/index.js +26 -25
- package/agnostic/misc/is-constructor-function/index.js +1 -0
- package/agnostic/misc/is-nullish/index.js +1 -0
- package/agnostic/misc/logs/index.js +3 -2
- package/agnostic/misc/logs/logger/index.js +1 -0
- package/agnostic/misc/logs/make-text-block/index.js +1 -0
- package/agnostic/misc/logs/styles/index.js +1 -0
- package/agnostic/misc/lorem-ipsum/index.js +12 -11
- package/agnostic/misc/outcome/index.js +1 -0
- package/agnostic/numbers/absolute-modulo/index.js +1 -0
- package/agnostic/numbers/clamp/index.js +1 -0
- package/agnostic/numbers/index.js +6 -5
- package/agnostic/numbers/interpolate/index.js +1 -0
- package/agnostic/numbers/responsive-harmonics/index.js +1 -0
- package/agnostic/numbers/round/index.js +1 -0
- package/agnostic/objects/deep-get-property/index.js +1 -0
- package/agnostic/objects/enums/index.js +1 -0
- package/agnostic/objects/enums/is-in-enum/index.js +1 -0
- package/agnostic/objects/flatten-getters/index.js +1 -0
- package/agnostic/objects/index.js +15 -14
- package/agnostic/objects/is-object/index.js +1 -0
- package/agnostic/objects/is-record/index.js +1 -0
- package/agnostic/objects/record-format/index.js +1 -0
- package/agnostic/objects/record-map/index.js +1 -0
- package/agnostic/objects/validation/index.js +1 -0
- package/agnostic/optim/index.js +1 -0
- package/agnostic/optim/memoize/index.js +1 -0
- package/agnostic/optim/throttle-debounce/index.js +1 -0
- package/agnostic/random/hex-char/index.js +1 -0
- package/agnostic/random/index.js +1 -0
- package/agnostic/random/random/index.js +1 -0
- package/agnostic/random/uuid/index.js +1 -0
- package/agnostic/regexps/index.js +2 -0
- package/agnostic/strings/char-codes/index.js +1 -0
- package/agnostic/strings/index.js +6 -5
- package/agnostic/strings/matches/index.js +1 -0
- package/agnostic/strings/normalize-indent/index.js +1 -0
- package/agnostic/strings/replace-all/index.js +1 -0
- package/agnostic/strings/to-alphanum/index.js +1 -0
- package/agnostic/strings/trim/index.js +1 -0
- package/agnostic/time/dates/format-date/index.js +1 -0
- package/agnostic/time/dates/index.js +1 -0
- package/agnostic/time/duration/index.js +1 -0
- package/agnostic/time/index.js +4 -3
- package/agnostic/time/timeout/index.js +1 -0
- package/agnostic/time/transitions/index.js +1 -0
- package/agnostic/time/wait/index.js +1 -0
- package/chunks/chunk-2KCKWG7R.js +104 -0
- package/chunks/chunk-365LSZZ7.js +37 -0
- package/chunks/chunk-4FOK7DUZ.js +35 -0
- package/chunks/chunk-4LCL2RIC.js +209 -0
- package/chunks/chunk-4WOAFIVN.js +31 -0
- package/chunks/chunk-53MBV4TG.js +6212 -0
- package/chunks/chunk-57YCNOX7.js +15 -0
- package/chunks/chunk-5QVKJGTN.js +95 -0
- package/chunks/chunk-6GZXU2Z3.js +191 -0
- package/chunks/chunk-7QIYI4CK.js +209 -0
- package/chunks/chunk-AF2MI5O5.js +29 -0
- package/chunks/chunk-ARDAQZRR.js +239 -0
- package/chunks/chunk-BLAAWANI.js +191 -0
- package/chunks/chunk-BV67SWXG.js +20 -0
- package/chunks/chunk-CIJQHLIW.js +31 -0
- package/chunks/chunk-DHMARF6D.js +62 -0
- package/chunks/chunk-DHWHB53F.js +191 -0
- package/chunks/chunk-DMR2WE3C.js +62 -0
- package/chunks/chunk-DPBYDWV3.js +2369 -0
- package/chunks/chunk-ECKOTCS4.js +2369 -0
- package/chunks/chunk-EEIJDUNV.js +209 -0
- package/chunks/chunk-EIU72AEZ.js +31 -0
- package/chunks/chunk-F5GXXF3A.js +31 -0
- package/chunks/chunk-FG53JEP2.js +31 -0
- package/chunks/chunk-FTIDPZZ5.js +209 -0
- package/chunks/chunk-GARJTJ6V.js +6 -0
- package/chunks/chunk-GL54CDM2.js +20 -0
- package/chunks/chunk-GNZY3ZTH.js +14 -0
- package/chunks/chunk-GWXVHCAB.js +31 -0
- package/chunks/chunk-I2ILSLBK.js +32 -0
- package/chunks/chunk-IGHRNHVK.js +16 -0
- package/chunks/chunk-IOWZMFCU.js +28 -0
- package/chunks/chunk-IPON4W2H.js +31 -0
- package/chunks/chunk-IUFAHY2R.js +38 -0
- package/chunks/chunk-JBSS64SA.js +6 -0
- package/chunks/chunk-JRXTMXKV.js +15967 -0
- package/chunks/chunk-KEYRP27F.js +191 -0
- package/chunks/chunk-KYMCGWPM.js +31 -0
- package/chunks/chunk-L5JWJRZ7.js +484 -0
- package/chunks/chunk-L7EUEQZP.js +0 -0
- package/chunks/chunk-LAA2DQDK.js +31 -0
- package/chunks/chunk-LATEK24U.js +31 -0
- package/chunks/chunk-LDLSU4OG.js +191 -0
- package/chunks/chunk-LWWXPVXY.js +25173 -0
- package/chunks/chunk-MMPJODO2.js +31 -0
- package/chunks/chunk-MY4VMHSH.js +191 -0
- package/chunks/chunk-MZ2RAM5Y.js +62 -0
- package/chunks/chunk-NGYJGQT3.js +25002 -0
- package/chunks/chunk-NIOOIUSD.js +104 -0
- package/chunks/chunk-NLHFSJYR.js +15 -0
- package/chunks/chunk-NQ5ESZNO.js +191 -0
- package/chunks/chunk-O6NULFZI.js +37 -0
- package/chunks/chunk-OVMNSJOW.js +6 -0
- package/chunks/chunk-PPK2JEO6.js +28 -0
- package/chunks/chunk-PVHLWKA6.js +31 -0
- package/chunks/chunk-QMWX2A56.js +56 -0
- package/chunks/chunk-QPBY235R.js +239 -0
- package/chunks/chunk-REBANVPP.js +104 -0
- package/chunks/chunk-RSMUYH5H.js +31 -0
- package/chunks/chunk-RVVJ4QD4.js +173 -0
- package/chunks/chunk-TSQVG7GA.js +31 -0
- package/chunks/chunk-TXOUGP37.js +62 -0
- package/chunks/chunk-UG36UPJK.js +31 -0
- package/chunks/chunk-UXM54YBI.js +68 -0
- package/chunks/chunk-VHFMQI7Z.js +20 -0
- package/chunks/chunk-VP3Y6EMX.js +190 -0
- package/chunks/chunk-WLHJM76F.js +2369 -0
- package/chunks/chunk-WNLP6R5Y.js +191 -0
- package/chunks/chunk-WQKFVIUF.js +37 -0
- package/chunks/chunk-WSFCRVEQ.js +9 -0
- package/chunks/chunk-WTPUSGMJ.js +104 -0
- package/chunks/chunk-XCBH6NLF.js +42 -0
- package/chunks/chunk-XETVQW6S.js +56 -0
- package/chunks/chunk-XT6XKGKK.js +20 -0
- package/chunks/chunk-YDNQHZRS.js +31 -0
- package/chunks/chunk-YHT73ULP.js +2369 -0
- package/chunks/chunk-YRSNU7IX.js +49 -0
- package/chunks/chunk-YVSS4IT2.js +37 -0
- package/chunks/chunk-YZDZQ7AZ.js +37 -0
- package/chunks/chunk-Z4SQDCFG.js +37 -0
- package/chunks/chunk-ZS5OHINP.js +31 -0
- package/components/Comp/index.js +2 -0
- package/node/@design-edito/index.d.ts +2 -0
- package/node/@design-edito/index.js +12 -0
- package/node/@design-edito/thumbnails/colors/index.d.ts +35 -0
- package/node/@design-edito/thumbnails/colors/index.js +29 -0
- package/node/@design-edito/thumbnails/common/index.d.ts +5 -0
- package/node/@design-edito/thumbnails/common/index.js +15 -0
- package/node/@design-edito/thumbnails/easings/index.d.ts +8 -0
- package/node/@design-edito/thumbnails/easings/index.js +21 -0
- package/node/@design-edito/thumbnails/index.d.ts +5 -0
- package/node/@design-edito/thumbnails/index.js +20 -0
- package/node/@design-edito/thumbnails/layout/index.d.ts +63 -0
- package/node/@design-edito/thumbnails/layout/index.js +31 -0
- package/node/@express/@multer/index.d.ts +22 -0
- package/node/@express/@multer/index.js +9 -0
- package/node/@express/index.d.ts +2 -0
- package/node/@express/index.js +9 -0
- package/node/@google-cloud/index.d.ts +2 -0
- package/node/@google-cloud/index.js +24 -0
- package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +18 -0
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +9 -0
- package/node/@google-cloud/storage/bucket/index.d.ts +3 -0
- package/node/@google-cloud/storage/bucket/index.js +14 -0
- package/node/@google-cloud/storage/bucket/list/index.d.ts +17 -0
- package/node/@google-cloud/storage/bucket/list/index.js +9 -0
- package/node/@google-cloud/storage/file/copy/index.d.ts +21 -0
- package/node/@google-cloud/storage/file/copy/index.js +9 -0
- package/node/@google-cloud/storage/file/download/index.d.ts +20 -0
- package/node/@google-cloud/storage/file/download/index.js +9 -0
- package/node/@google-cloud/storage/file/erase/index.d.ts +20 -0
- package/node/@google-cloud/storage/file/erase/index.js +9 -0
- package/node/@google-cloud/storage/file/exists/index.d.ts +19 -0
- package/node/@google-cloud/storage/file/exists/index.js +9 -0
- package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +23 -0
- package/node/@google-cloud/storage/file/generate-signed-url/index.js +9 -0
- package/node/@google-cloud/storage/file/get-metadata/index.d.ts +22 -0
- package/node/@google-cloud/storage/file/get-metadata/index.js +9 -0
- package/node/@google-cloud/storage/file/get-permissions/index.d.ts +19 -0
- package/node/@google-cloud/storage/file/get-permissions/index.js +9 -0
- package/node/@google-cloud/storage/file/index.d.ts +12 -0
- package/node/@google-cloud/storage/file/index.js +50 -0
- package/node/@google-cloud/storage/file/move/index.d.ts +24 -0
- package/node/@google-cloud/storage/file/move/index.js +9 -0
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +26 -0
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +12 -0
- package/node/@google-cloud/storage/file/update-metadata/index.d.ts +24 -0
- package/node/@google-cloud/storage/file/update-metadata/index.js +9 -0
- package/node/@google-cloud/storage/file/upload/index.d.ts +21 -0
- package/node/@google-cloud/storage/file/upload/index.js +9 -0
- package/node/@google-cloud/storage/index.d.ts +3 -0
- package/node/@google-cloud/storage/index.js +27 -0
- package/node/encryption/buffer/index.d.ts +55 -0
- package/node/encryption/buffer/index.js +16 -0
- package/node/encryption/generate-key/index.d.ts +16 -0
- package/node/encryption/generate-key/index.js +7 -0
- package/node/encryption/index.d.ts +5 -0
- package/node/encryption/index.js +29 -0
- package/node/encryption/uint8-array/index.d.ts +57 -0
- package/node/encryption/uint8-array/index.js +15 -0
- package/node/files/index.d.ts +4 -6
- package/node/files/index.js +10 -10
- package/node/files/is-in-directory/index.js +1 -0
- package/node/files/read-write/index.d.ts +1 -1
- package/node/files/read-write/index.js +1 -0
- package/node/files/subpaths/index.js +1 -0
- package/node/images/exports/index.d.ts +15 -0
- package/node/images/exports/index.js +11 -0
- package/node/images/index.d.ts +4 -0
- package/node/images/index.js +24 -0
- package/node/images/prepare/index.d.ts +17 -0
- package/node/images/prepare/index.js +22 -0
- package/node/images/transform/area-composition/index.d.ts +60 -0
- package/node/images/transform/area-composition/index.js +16 -0
- package/node/images/transform/index.d.ts +30 -0
- package/node/images/transform/index.js +17 -0
- package/node/index.d.ts +8 -6
- package/node/process/index.d.ts +5 -7
- package/node/process/index.js +11 -9
- package/node/process/on-exit/index.js +1 -0
- package/package.json +15 -2
@@ -0,0 +1,104 @@
|
|
1
|
+
import {
|
2
|
+
exportZipBuffer,
|
3
|
+
prepareExport
|
4
|
+
} from "./chunk-LWWXPVXY.js";
|
5
|
+
import {
|
6
|
+
transformImage
|
7
|
+
} from "./chunk-DMR2WE3C.js";
|
8
|
+
import {
|
9
|
+
require_lib
|
10
|
+
} from "./chunk-53MBV4TG.js";
|
11
|
+
import {
|
12
|
+
thumbnails_exports
|
13
|
+
} from "./chunk-IOWZMFCU.js";
|
14
|
+
import {
|
15
|
+
__export,
|
16
|
+
__toESM
|
17
|
+
} from "./chunk-XCBH6NLF.js";
|
18
|
+
|
19
|
+
// src/node/images/prepare/index.ts
|
20
|
+
var prepare_exports = {};
|
21
|
+
__export(prepare_exports, {
|
22
|
+
MAX_NB_OUTPUTS: () => MAX_NB_OUTPUTS,
|
23
|
+
OUTPUT_ZIP_FOLDER: () => OUTPUT_ZIP_FOLDER,
|
24
|
+
prepareImage: () => prepareImage
|
25
|
+
});
|
26
|
+
var import_sharp = __toESM(require_lib(), 1);
|
27
|
+
var MAX_NB_OUTPUTS = 50;
|
28
|
+
var OUTPUT_ZIP_FOLDER = "./output-zips";
|
29
|
+
async function prepareImage(imageBuffer, customOptions) {
|
30
|
+
const sharpImage = (0, import_sharp.default)(imageBuffer);
|
31
|
+
const sharpImageMetadata = await sharpImage.metadata();
|
32
|
+
const imageBufferMetadata = {
|
33
|
+
width: sharpImageMetadata.width || 0,
|
34
|
+
height: sharpImageMetadata.height || 0,
|
35
|
+
format: sharpImageMetadata.format || "png"
|
36
|
+
};
|
37
|
+
const options = getOptions(imageBufferMetadata, customOptions);
|
38
|
+
const nbOutputs = options.qualities.length * (options.ratios.length + 1) * (options.widths.length + 1) * (options.heights.length + 1);
|
39
|
+
if (nbOutputs > MAX_NB_OUTPUTS) {
|
40
|
+
throw Error("Nb output exceeds supported max nb output");
|
41
|
+
}
|
42
|
+
const transformedBuffer = await transformImage(imageBuffer, options.inputOperations, {
|
43
|
+
width: thumbnails_exports.Common.getArrayMax(options.widths) || 0,
|
44
|
+
height: thumbnails_exports.Common.getArrayMax(options.heights) || 0
|
45
|
+
});
|
46
|
+
const exportsBuffers = [{
|
47
|
+
buffer: imageBuffer,
|
48
|
+
name: generateFileName({
|
49
|
+
...imageBufferMetadata,
|
50
|
+
quality: 100,
|
51
|
+
suffix: "original",
|
52
|
+
preffix: options.name
|
53
|
+
})
|
54
|
+
}];
|
55
|
+
for await (const width of options.widths) {
|
56
|
+
for await (const height of options.heights) {
|
57
|
+
for await (const quality of options.qualities) {
|
58
|
+
for await (const format of options.formats) {
|
59
|
+
const exportBuffer = await prepareExport(transformedBuffer, {
|
60
|
+
format,
|
61
|
+
quality,
|
62
|
+
width,
|
63
|
+
height
|
64
|
+
});
|
65
|
+
exportsBuffers.push({
|
66
|
+
buffer: exportBuffer,
|
67
|
+
name: generateFileName({ width, height, quality, format, preffix: options.name })
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
const zipBuffer = exportZipBuffer(exportsBuffers, generateZipName());
|
74
|
+
return zipBuffer;
|
75
|
+
}
|
76
|
+
function getOptions(imageBufferMetadata, options) {
|
77
|
+
return {
|
78
|
+
center: [0.5, 0.5],
|
79
|
+
qualities: [100],
|
80
|
+
inputOperations: [],
|
81
|
+
...options,
|
82
|
+
name: options?.name || "",
|
83
|
+
formats: [imageBufferMetadata.format, ...options?.formats ? options.formats : []],
|
84
|
+
ratios: [...options?.ratios ? options.ratios : []],
|
85
|
+
widths: [imageBufferMetadata.width, ...options?.widths ? options.widths : []],
|
86
|
+
heights: [imageBufferMetadata.height, ...options?.heights ? options.heights : []]
|
87
|
+
};
|
88
|
+
}
|
89
|
+
function generateZipName() {
|
90
|
+
const date = /* @__PURE__ */ new Date();
|
91
|
+
return `image-exports_${date.toLocaleDateString()}_${date.toLocaleTimeString()}_${date.getTime()}`.replace(/\/|:/g, "-").replace(/ /g, "").trim();
|
92
|
+
}
|
93
|
+
function generateFileName({ width, height, quality, format, suffix, preffix }) {
|
94
|
+
const _preffix = preffix ? `${preffix}_` : "image-formats_";
|
95
|
+
const _suffix = `${suffix ? `_${suffix}` : ""}.${format}`;
|
96
|
+
return `${_preffix}${width}${height}_Q${quality}${_suffix}`;
|
97
|
+
}
|
98
|
+
|
99
|
+
export {
|
100
|
+
MAX_NB_OUTPUTS,
|
101
|
+
OUTPUT_ZIP_FOLDER,
|
102
|
+
prepareImage,
|
103
|
+
prepare_exports
|
104
|
+
};
|
@@ -0,0 +1,191 @@
|
|
1
|
+
import {
|
2
|
+
Random
|
3
|
+
} from "./chunk-S32K7POB.js";
|
4
|
+
import {
|
5
|
+
Arrays
|
6
|
+
} from "./chunk-MMPJODO2.js";
|
7
|
+
|
8
|
+
// src/agnostic/misc/lorem-ipsum/index.ts
|
9
|
+
var LoremIpsum;
|
10
|
+
((LoremIpsum2) => {
|
11
|
+
LoremIpsum2.words = [
|
12
|
+
"a",
|
13
|
+
"ac",
|
14
|
+
"accumsan",
|
15
|
+
"adipiscing",
|
16
|
+
"aenean",
|
17
|
+
"aliquam",
|
18
|
+
"aliquet",
|
19
|
+
"amet",
|
20
|
+
"ante",
|
21
|
+
"arcu",
|
22
|
+
"at",
|
23
|
+
"auctor",
|
24
|
+
"augue",
|
25
|
+
"bibendum",
|
26
|
+
"blandit",
|
27
|
+
"condimentum",
|
28
|
+
"consectetur",
|
29
|
+
"consequat",
|
30
|
+
"convallis",
|
31
|
+
"cras",
|
32
|
+
"curabitur",
|
33
|
+
"cursus",
|
34
|
+
"dapibus",
|
35
|
+
"diam",
|
36
|
+
"dictum",
|
37
|
+
"dictumst",
|
38
|
+
"dignissim",
|
39
|
+
"dolor",
|
40
|
+
"donec",
|
41
|
+
"dui",
|
42
|
+
"duis",
|
43
|
+
"efficitur",
|
44
|
+
"egestas",
|
45
|
+
"eget",
|
46
|
+
"eleifend",
|
47
|
+
"elementum",
|
48
|
+
"elit",
|
49
|
+
"enim",
|
50
|
+
"erat",
|
51
|
+
"eros",
|
52
|
+
"est",
|
53
|
+
"et",
|
54
|
+
"eu",
|
55
|
+
"euismod",
|
56
|
+
"ex",
|
57
|
+
"facilisis",
|
58
|
+
"faucibus",
|
59
|
+
"felis",
|
60
|
+
"feugiat",
|
61
|
+
"finibus",
|
62
|
+
"fringilla",
|
63
|
+
"fusce",
|
64
|
+
"gravida",
|
65
|
+
"habitasse",
|
66
|
+
"hac",
|
67
|
+
"hendrerit",
|
68
|
+
"iaculis",
|
69
|
+
"id",
|
70
|
+
"imperdiet",
|
71
|
+
"in",
|
72
|
+
"integer",
|
73
|
+
"interdum",
|
74
|
+
"ipsum",
|
75
|
+
"justo",
|
76
|
+
"lacinia",
|
77
|
+
"lacus",
|
78
|
+
"laoreet",
|
79
|
+
"lectus",
|
80
|
+
"leo",
|
81
|
+
"libero",
|
82
|
+
"ligula",
|
83
|
+
"lobortis",
|
84
|
+
"lorem",
|
85
|
+
"luctus",
|
86
|
+
"maecenas",
|
87
|
+
"magna",
|
88
|
+
"malesuada",
|
89
|
+
"massa",
|
90
|
+
"mattis",
|
91
|
+
"mauris",
|
92
|
+
"maximus",
|
93
|
+
"metus",
|
94
|
+
"mi",
|
95
|
+
"molestie",
|
96
|
+
"mollis",
|
97
|
+
"morbi",
|
98
|
+
"nam",
|
99
|
+
"nec",
|
100
|
+
"neque",
|
101
|
+
"nibh",
|
102
|
+
"nisi",
|
103
|
+
"nisl",
|
104
|
+
"non",
|
105
|
+
"nulla",
|
106
|
+
"nullam",
|
107
|
+
"nunc",
|
108
|
+
"odio",
|
109
|
+
"orci",
|
110
|
+
"ornare",
|
111
|
+
"pellentesque",
|
112
|
+
"pharetra",
|
113
|
+
"phasellus",
|
114
|
+
"placerat",
|
115
|
+
"platea",
|
116
|
+
"porta",
|
117
|
+
"porttitor",
|
118
|
+
"posuere",
|
119
|
+
"praesent",
|
120
|
+
"pulvinar",
|
121
|
+
"purus",
|
122
|
+
"quam",
|
123
|
+
"quis",
|
124
|
+
"quisque",
|
125
|
+
"risus",
|
126
|
+
"rutrum",
|
127
|
+
"sagittis",
|
128
|
+
"sapien",
|
129
|
+
"sed",
|
130
|
+
"sem",
|
131
|
+
"semper",
|
132
|
+
"sit",
|
133
|
+
"sodales",
|
134
|
+
"sollicitudin",
|
135
|
+
"suscipit",
|
136
|
+
"suspendisse",
|
137
|
+
"tellus",
|
138
|
+
"tempor",
|
139
|
+
"tempus",
|
140
|
+
"tincidunt",
|
141
|
+
"tortor",
|
142
|
+
"tristique",
|
143
|
+
"turpis",
|
144
|
+
"ultrices",
|
145
|
+
"ultricies",
|
146
|
+
"urna",
|
147
|
+
"ut",
|
148
|
+
"vehicula",
|
149
|
+
"vel",
|
150
|
+
"velit",
|
151
|
+
"venenatis",
|
152
|
+
"vestibulum",
|
153
|
+
"vitae",
|
154
|
+
"vivamus",
|
155
|
+
"viverra",
|
156
|
+
"volutpat",
|
157
|
+
"vulputate"
|
158
|
+
];
|
159
|
+
LoremIpsum2.generateSentence = (wordCount) => {
|
160
|
+
const resultArr = [];
|
161
|
+
let currentWordCound = wordCount;
|
162
|
+
for (let i = 0; i < currentWordCound; i++) {
|
163
|
+
const picked = Arrays.randomPick(LoremIpsum2.words);
|
164
|
+
if (typeof picked === "string") resultArr.push(picked);
|
165
|
+
else {
|
166
|
+
currentWordCound += 1;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
const [firstWord, ...otherWords] = resultArr;
|
170
|
+
if (firstWord === void 0) return "";
|
171
|
+
const capFirstLetter = firstWord?.charAt(0).toUpperCase();
|
172
|
+
const restOfFirstWord = firstWord?.slice(1);
|
173
|
+
const sentence = [
|
174
|
+
`${capFirstLetter}${restOfFirstWord}`,
|
175
|
+
...otherWords
|
176
|
+
].join(" ");
|
177
|
+
return `${sentence}.`;
|
178
|
+
};
|
179
|
+
LoremIpsum2.generateSentences = (sentencesCount, maxSentenceLength = 12, minSentenceLength = 4) => {
|
180
|
+
const sentences = [];
|
181
|
+
for (let i = 0; i < sentencesCount; i++) {
|
182
|
+
const length = Random.randomInt(maxSentenceLength, minSentenceLength) ?? 8;
|
183
|
+
sentences.push((0, LoremIpsum2.generateSentence)(length));
|
184
|
+
}
|
185
|
+
return sentences;
|
186
|
+
};
|
187
|
+
})(LoremIpsum || (LoremIpsum = {}));
|
188
|
+
|
189
|
+
export {
|
190
|
+
LoremIpsum
|
191
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {
|
2
|
+
download
|
3
|
+
} from "./chunk-LAA2DQDK.js";
|
4
|
+
import {
|
5
|
+
upload
|
6
|
+
} from "./chunk-RSMUYH5H.js";
|
7
|
+
import {
|
8
|
+
erase
|
9
|
+
} from "./chunk-FG53JEP2.js";
|
10
|
+
import {
|
11
|
+
Outcome
|
12
|
+
} from "./chunk-JMU5PDBD.js";
|
13
|
+
import {
|
14
|
+
__export
|
15
|
+
} from "./chunk-XCBH6NLF.js";
|
16
|
+
|
17
|
+
// src/node/@google-cloud/storage/file/revoke-signed-urls/index.ts
|
18
|
+
var revoke_signed_urls_exports = {};
|
19
|
+
__export(revoke_signed_urls_exports, {
|
20
|
+
revokeSignedUrls: () => revokeSignedUrls
|
21
|
+
});
|
22
|
+
async function revokeSignedUrls(sourcePath, bucket, options) {
|
23
|
+
const { downloadOptions, eraseOptions, uploadOptions } = options ?? {};
|
24
|
+
const downloadAttempt = await download(sourcePath, bucket, downloadOptions);
|
25
|
+
if (!downloadAttempt.success) return downloadAttempt;
|
26
|
+
const deletionAttempt = await erase(sourcePath, bucket, eraseOptions);
|
27
|
+
if (!deletionAttempt.success) return deletionAttempt;
|
28
|
+
const downloaded = downloadAttempt.payload;
|
29
|
+
const reuploadAttempt = await upload(downloaded, sourcePath, bucket, uploadOptions);
|
30
|
+
if (!reuploadAttempt.success) return reuploadAttempt;
|
31
|
+
return Outcome.makeSuccess(true);
|
32
|
+
}
|
33
|
+
|
34
|
+
export {
|
35
|
+
revokeSignedUrls,
|
36
|
+
revoke_signed_urls_exports
|
37
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import {
|
2
|
+
colors_exports
|
3
|
+
} from "./chunk-L5JWJRZ7.js";
|
4
|
+
import {
|
5
|
+
layout_exports
|
6
|
+
} from "./chunk-ARDAQZRR.js";
|
7
|
+
import {
|
8
|
+
easings_exports
|
9
|
+
} from "./chunk-UXM54YBI.js";
|
10
|
+
import {
|
11
|
+
common_exports
|
12
|
+
} from "./chunk-YRSNU7IX.js";
|
13
|
+
import {
|
14
|
+
__export
|
15
|
+
} from "./chunk-XCBH6NLF.js";
|
16
|
+
|
17
|
+
// src/node/@design-edito/thumbnails/index.ts
|
18
|
+
var thumbnails_exports = {};
|
19
|
+
__export(thumbnails_exports, {
|
20
|
+
Colors: () => colors_exports,
|
21
|
+
Common: () => common_exports,
|
22
|
+
Easings: () => easings_exports,
|
23
|
+
Layout: () => layout_exports
|
24
|
+
});
|
25
|
+
|
26
|
+
export {
|
27
|
+
thumbnails_exports
|
28
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-JMU5PDBD.js";
|
4
|
+
import {
|
5
|
+
unknownToString
|
6
|
+
} from "./chunk-FENXVJYO.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-XCBH6NLF.js";
|
10
|
+
|
11
|
+
// src/node/@google-cloud/storage/file/copy/index.ts
|
12
|
+
var copy_exports = {};
|
13
|
+
__export(copy_exports, {
|
14
|
+
copy: () => copy
|
15
|
+
});
|
16
|
+
async function copy(sourcePath, destinationPath, bucket, options) {
|
17
|
+
const { fileOptions, copyOptions } = options ?? {};
|
18
|
+
try {
|
19
|
+
const file = bucket.file(sourcePath, fileOptions);
|
20
|
+
await file.copy(destinationPath, copyOptions);
|
21
|
+
return Outcome.makeSuccess(true);
|
22
|
+
} catch (err) {
|
23
|
+
const errStr = unknownToString(err);
|
24
|
+
return Outcome.makeFailure(errStr);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
export {
|
29
|
+
copy,
|
30
|
+
copy_exports
|
31
|
+
};
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import {
|
2
|
+
revoke_signed_urls_exports
|
3
|
+
} from "./chunk-YZDZQ7AZ.js";
|
4
|
+
import {
|
5
|
+
upload_exports
|
6
|
+
} from "./chunk-RSMUYH5H.js";
|
7
|
+
import {
|
8
|
+
move_exports
|
9
|
+
} from "./chunk-I2ILSLBK.js";
|
10
|
+
import {
|
11
|
+
update_metadata_exports
|
12
|
+
} from "./chunk-UG36UPJK.js";
|
13
|
+
import {
|
14
|
+
copy_exports
|
15
|
+
} from "./chunk-PVHLWKA6.js";
|
16
|
+
import {
|
17
|
+
download_exports
|
18
|
+
} from "./chunk-LAA2DQDK.js";
|
19
|
+
import {
|
20
|
+
erase_exports
|
21
|
+
} from "./chunk-FG53JEP2.js";
|
22
|
+
import {
|
23
|
+
generate_signed_url_exports
|
24
|
+
} from "./chunk-4FOK7DUZ.js";
|
25
|
+
import {
|
26
|
+
exists_exports
|
27
|
+
} from "./chunk-CIJQHLIW.js";
|
28
|
+
import {
|
29
|
+
get_permissions_exports
|
30
|
+
} from "./chunk-F5GXXF3A.js";
|
31
|
+
import {
|
32
|
+
get_metadata_exports
|
33
|
+
} from "./chunk-YDNQHZRS.js";
|
34
|
+
import {
|
35
|
+
__export
|
36
|
+
} from "./chunk-XCBH6NLF.js";
|
37
|
+
|
38
|
+
// src/node/@google-cloud/storage/file/index.ts
|
39
|
+
var file_exports = {};
|
40
|
+
__export(file_exports, {
|
41
|
+
Copy: () => copy_exports,
|
42
|
+
Download: () => download_exports,
|
43
|
+
Erase: () => erase_exports,
|
44
|
+
Exists: () => exists_exports,
|
45
|
+
GenerateSignedUrl: () => generate_signed_url_exports,
|
46
|
+
GetMetaData: () => get_metadata_exports,
|
47
|
+
GetPermissions: () => get_permissions_exports,
|
48
|
+
Move: () => move_exports,
|
49
|
+
RevokeSignedUrls: () => revoke_signed_urls_exports,
|
50
|
+
UpdateMetadata: () => update_metadata_exports,
|
51
|
+
Upload: () => upload_exports
|
52
|
+
});
|
53
|
+
|
54
|
+
export {
|
55
|
+
file_exports
|
56
|
+
};
|