dozy 1.0.82 → 1.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -790,11 +790,29 @@ declare const $crypto: Crypto | undefined;
790
790
 
791
791
  type ScaleComputer = undefined | ((scaler: Scaler) => number);
792
792
  type ScaleIniter = (scaler: Scaler) => void;
793
+ type ScaleResponsiveOptions = {
794
+ /**
795
+ * xls 横屏模式下的 base 乘数。
796
+ *
797
+ * 默认写成 `640 / 320`,方便直观看出是从 320 基准扩展到 640 基准。
798
+ */
799
+ baseMultiplier?: number;
800
+ /**
801
+ * xls 横屏模式下的最大宽高比。
802
+ *
803
+ * 默认写成 `1.2`。
804
+ */
805
+ xlsMaxAspectRatio?: number;
806
+ /** xls 状态变化时触发,方便业务侧保存状态。 */
807
+ setXls?: (b: boolean) => void;
808
+ };
793
809
  declare class Scaler {
794
810
  #private;
795
811
  heightElement: HTMLElement;
796
812
  widthElement: HTMLElement;
797
813
  offsetHorizontal: number;
814
+ /** 未进入 xls 响应式扩展前的基础内容宽度,setBase 会更新这个值。 */
815
+ sourceBase: number;
798
816
  set base(val: number);
799
817
  get base(): number;
800
818
  set mainScale(val: number);
@@ -846,6 +864,7 @@ declare function enableScaler(outerContainer: HTMLElement, initer?: ScaleIniter,
846
864
  * @param args.heightElement 可选高度测量元素,默认使用 `document.documentElement`。
847
865
  * @param args.widthElement 可选宽度测量元素,默认使用 `document.documentElement`。
848
866
  * @param args.base 可选基础内容宽度。
867
+ * @param args.responsive 传入后启用 xls 横屏响应式:宽大于高时切换 base 与 maxAspectRatio,并同步 `html[data-xad-xls]`。
849
868
  * @returns 返回一个可供 `enableScaler` 使用的 `ScaleIniter` 函数。
850
869
  */
851
870
  declare const standardIniter: (args: {
@@ -857,6 +876,7 @@ declare const standardIniter: (args: {
857
876
  heightElement?: HTMLElement;
858
877
  widthElement?: HTMLElement;
859
878
  base?: number;
879
+ responsive?: ScaleResponsiveOptions;
860
880
  }) => ScaleIniter;
861
881
 
862
882
  declare class StringObfuscator {
@@ -1395,6 +1415,6 @@ declare function toRgbString(input: string | Color | any): string | undefined;
1395
1415
  */
1396
1416
  declare function toHslString(input: string | Color | any): string | undefined;
1397
1417
 
1398
- declare const DOZY = "1.0.82";
1418
+ declare const DOZY = "1.0.84";
1399
1419
 
1400
- export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $backgroundColor, $borderColor, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $compressImageBase64, $compressImageDefaultOptions, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatPoints, $formatPointsWithChange, $formatWithCommas, $freeze, $genSSF, $getFileType, $getHue, $getTimeString, $hasKey, $if, $inRange, $inRange2, $inferExtensionFormPureBase64, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, RepoStore, type ScaleComputer, type ScaleIniter, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, isValidColor, maybeString, registerCustomColor, s, shanghaiDateFormatter, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };
1420
+ export { $Headers, $Request, $Response, $URL, $URLSearchParams, $arrayFrom, $arrayIsArray, $assign, $backgroundColor, $borderColor, $capitalize, $checkValidEmailWithUnicode, $clamp, $clearInterval, $clearTimeout, $clone, $compressImage, $compressImageBase64, $compressImageDefaultOptions, $copy, $crypto, $date, $decodeBase64ToBinary, $decodeBase64ToUnicode, $deepClone, $defineProperty, $document, $encodeUnicodeToBase64, $entries, $escapeHTML, $fallbackCopy, $fetch, $fileToBase64, $formatDate, $formatPoints, $formatPointsWithChange, $formatWithCommas, $freeze, $genSSF, $getFileType, $getHue, $getTimeString, $hasKey, $if, $inRange, $inRange2, $inferExtensionFormPureBase64, $inferMimeTypeFormPureBase64, $is, $isObject, $isPlainClass, $isValidEmailWithUnicode, $isValidOrBriefURL, $jsonParse, $jsonStringify, $keys, $lastIndex, $lindex, $loadOpt, $location, $log, $lplus, $magic, $math, $now, $numberIsFinite, $numberIsNaN, $oc, $open, $parseParams, $promise, $pureText, $purifyBase64, $randomByte, $replaceHolesWithUndefined, $rmvSlash, $rsValue, $rsetValue, $rvalue, $s, $sc, $setInterval, $setRange, $setTimeout, $stringFromCharCode, $stringFromCodePoint, $stringToRange, $strings, $toDataUrlFromBase64, $validName, $values, $window, type Any, type Atoa, type Coord, type Coord3, DOZY, type DozyConfig, type DozyConfigItem, type FileType, Gens, type Hel, type IOpt, type Items, type Null, type Nullable, RainbowGen, RepoStore, type ScaleComputer, type ScaleIniter, type ScaleResponsiveOptions, StringObfuscator, type UNumber, __GensDirectives, _res, boxShadow, dozy, enableScaler, err403, errArg, errCode, errContent, errMsg, errNotLoggedIn, errToString, getBrightness, getColorMap, isNowAroundUtcHour, isNull, isValidColor, maybeString, registerCustomColor, s, shanghaiDateFormatter, smallChance, smartParse, smartString, standardIniter, textShadow, toHexString, toHslString, toRgbString, toRgbaArray, web$enableHttpsRedirect, web$enableProdProtector, web$encodeURI, web$pathStartData, web$redirectToDomain, web$setPathTarget, xtrim };