@unicom-cloud/utils 0.1.31 → 0.1.33
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/case-name/index.js +1 -1
- package/caseName.js +1 -1
- package/class-name/index.js +6 -5
- package/className.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/clipboardCopy.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/emoji.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/isMobile.js +7 -0
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +18 -17
- package/constant/protocol.js +1 -1
- package/constant/string.js +1 -1
- package/constant/ui.js +1 -1
- package/constant.js +1 -1
- package/content-disposition/index.js +1 -1
- package/contentDisposition.js +1 -1
- package/cookie/index.js +1 -1
- package/cookie/src/api.js +1 -1
- package/cookie/src/assign.js +1 -1
- package/cookie/src/converter.js +1 -1
- package/cookie.js +1 -1
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +5 -5
- package/date.js +5 -5
- package/decimal/decimal.js +1 -1
- package/decimal/index.js +1 -1
- package/decimal.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getElementCoordinates.js +46 -0
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +87 -84
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +2 -2
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/domHelpers.js +65 -63
- package/emitter/index.js +1 -1
- package/emitter/src/index.js +1 -1
- package/emitter.js +1 -1
- package/escape/index.js +11 -0
- package/escape.js +6 -0
- package/file/fileToURL.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/file.js +1 -1
- package/idb/index.js +1 -1
- package/idb.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/invariant.js +1 -1
- package/is/index.js +196 -141
- package/is/lib/isAscii.js +9 -0
- package/is/lib/isBase64.js +13 -0
- package/is/lib/isChinese.js +19 -0
- package/is/lib/isDataURI.js +25 -0
- package/is/lib/isEmail.js +72 -0
- package/is/lib/isFQDN.js +21 -0
- package/is/lib/isFullWidth.js +10 -0
- package/is/lib/isHSL.js +11 -0
- package/is/lib/isHalfWidth.js +10 -0
- package/is/lib/isHash.js +23 -0
- package/is/lib/isHexColor.js +12 -0
- package/is/lib/isIMEI.js +19 -0
- package/is/lib/isIP.js +21 -0
- package/is/lib/isIPRange.js +25 -0
- package/is/lib/isIdentityCard.js +190 -0
- package/is/lib/isJWT.js +14 -0
- package/is/lib/isMACAddress.js +9 -0
- package/is/lib/isMD5.js +9 -0
- package/is/lib/isMimeType.js +9 -0
- package/is/lib/isMobilePhone.js +192 -0
- package/is/lib/isPort.js +7 -0
- package/is/lib/isRgbColor.js +18 -0
- package/is/lib/isSemVer.js +20 -0
- package/is/lib/isSlug.js +9 -0
- package/is/lib/isStrongPassword.js +48 -0
- package/is/lib/isURL.js +78 -0
- package/is/lib/isUUID.js +24 -0
- package/is/lib/isVariableWidth.js +10 -0
- package/is/lib/util/assertString.js +12 -0
- package/is.js +122 -66
- package/lunar/index.js +1 -1
- package/lunar/lib/Holiday.js +1 -1
- package/lunar/lib/HolidayUtil.js +1 -1
- package/lunar/lib/I18n.js +1 -1
- package/lunar/lib/JieQi.js +1 -1
- package/lunar/lib/Lunar.js +1 -1
- package/lunar/lib/LunarMonth.js +1 -1
- package/lunar/lib/LunarTime.js +1 -1
- package/lunar/lib/LunarUtil.js +1 -1
- package/lunar/lib/LunarYear.js +1 -1
- package/lunar/lib/ShouXingUtil.js +1 -1
- package/lunar/lib/Solar.js +1 -1
- package/lunar/lib/SolarHalfYear.js +1 -1
- package/lunar/lib/SolarMonth.js +1 -1
- package/lunar/lib/SolarSeason.js +1 -1
- package/lunar/lib/SolarUtil.js +1 -1
- package/lunar/lib/SolarWeek.js +1 -1
- package/lunar/lib/SolarYear.js +1 -1
- package/lunar/lib/index.js +1 -1
- package/lunar.js +1 -1
- package/math/index.js +1 -1
- package/math.js +1 -1
- package/md5/index.js +1 -1
- package/md5.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/mock.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/normalizeWheel.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/numberToChinese.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/nzh.js +1 -1
- package/object-keys-sort/index.js +1 -1
- package/object-prototype-to-string-call/index.js +2 -2
- package/objectKeysSort.js +1 -1
- package/objectPrototypeToStringCall.js +1 -1
- package/package.json +1 -1
- package/pinyin/index.js +1 -1
- package/pinyin/simplified.js +1 -1
- package/pinyin/src/core.js +1 -1
- package/pinyin/src/simplified.js +6 -6
- package/pinyin/src/simplified_dict.js +5 -4
- package/pinyin/src/traditional.js +4 -4
- package/pinyin/src/traditional_dict.js +4 -3
- package/pinyin/traditional.js +1 -1
- package/pinyin.js +1 -1
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/queryString.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/random.js +1 -1
- package/screenfull/index.js +1 -1
- package/screenfull.js +1 -1
- package/sleep/index.js +1 -1
- package/sleep.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +1 -1
- package/snapdom/src/api/snapdom.js +198 -153
- package/snapdom/src/core/cache.js +1 -1
- package/snapdom/src/core/capture.js +121 -326
- package/snapdom/src/core/clone.js +117 -266
- package/snapdom/src/core/context.js +1 -1
- package/snapdom/src/core/plugins.js +1 -1
- package/snapdom/src/core/prepare.js +48 -157
- package/snapdom/src/exporters/download.js +15 -11
- package/snapdom/src/exporters/toBlob.js +10 -15
- package/snapdom/src/exporters/toCanvas.js +72 -65
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/modules/CSSVar.js +1 -1
- package/snapdom/src/modules/background.js +1 -1
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +1 -1
- package/snapdom/src/modules/fonts.js +118 -112
- package/snapdom/src/modules/iconFonts.js +133 -69
- package/snapdom/src/modules/images.js +36 -33
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pseudo.js +275 -161
- package/snapdom/src/modules/rasterize.js +6 -7
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +89 -67
- package/snapdom/src/modules/svgDefs.js +73 -60
- package/snapdom/src/utils/browser.js +13 -8
- package/snapdom/src/utils/capture.helpers.js +131 -0
- package/snapdom/src/utils/clone.helpers.js +283 -0
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +15 -24
- package/snapdom/src/utils/prepare.helpers.js +8 -0
- package/snapdom/src/utils/transforms.helpers.js +211 -0
- package/snapdom.js +1 -1
- package/string/index.js +1 -1
- package/string.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/src/conversion.js +1 -1
- package/tinycolor/src/css-color-names.js +1 -1
- package/tinycolor/src/format-input.js +1 -1
- package/tinycolor/src/from-ratio.js +12 -11
- package/tinycolor/src/index.js +1 -1
- package/tinycolor/src/random.js +30 -29
- package/tinycolor/src/readability.js +1 -1
- package/tinycolor/src/to-ms-filter.js +1 -1
- package/tinycolor/src/utils.js +1 -1
- package/tinycolor.js +1 -1
- package/tree/index.js +54 -75
- package/tree/search/index.js +1 -1
- package/tree.js +9 -11
- package/tween/index.js +1 -1
- package/tween/src/easing.js +1 -1
- package/tween/src/tween.js +15 -14
- package/tween.js +1 -1
- package/types/constant/isMobile.d.ts +3 -0
- package/types/date/index.d.ts +3 -3
- package/types/dom-helpers/getElementCoordinates.d.ts +40 -0
- package/types/dom-helpers/index.d.ts +3 -1
- package/types/escape/index.d.ts +2 -0
- package/types/is/index.d.ts +28 -1
- package/types/is/lib/isAscii.d.ts +1 -0
- package/types/is/lib/isBase64.d.ts +1 -0
- package/types/is/lib/isChinese.d.ts +4 -0
- package/types/is/lib/isDataURI.d.ts +1 -0
- package/types/is/lib/isEmail.d.ts +1 -0
- package/types/is/lib/isFQDN.d.ts +1 -0
- package/types/is/lib/isFullWidth.d.ts +2 -0
- package/types/is/lib/isHSL.d.ts +1 -0
- package/types/is/lib/isHalfWidth.d.ts +2 -0
- package/types/is/lib/isHash.d.ts +1 -0
- package/types/is/lib/isHexColor.d.ts +1 -0
- package/types/is/lib/isIMEI.d.ts +1 -0
- package/types/is/lib/isIP.d.ts +1 -0
- package/types/is/lib/isIPRange.d.ts +1 -0
- package/types/is/lib/isIdentityCard.d.ts +1 -0
- package/types/is/lib/isJWT.d.ts +1 -0
- package/types/is/lib/isMACAddress.d.ts +1 -0
- package/types/is/lib/isMD5.d.ts +1 -0
- package/types/is/lib/isMimeType.d.ts +1 -0
- package/types/is/lib/isMobilePhone.d.ts +2 -0
- package/types/is/lib/isOctal.d.ts +1 -0
- package/types/is/lib/isPort.d.ts +1 -0
- package/types/is/lib/isRgbColor.d.ts +1 -0
- package/types/is/lib/isSemVer.d.ts +1 -0
- package/types/is/lib/isSlug.d.ts +1 -0
- package/types/is/lib/isStrongPassword.d.ts +1 -0
- package/types/is/lib/isURL.d.ts +1 -0
- package/types/is/lib/isUUID.d.ts +1 -0
- package/types/is/lib/isVariableWidth.d.ts +1 -0
- package/types/is/lib/util/assertString.d.ts +1 -0
- package/types/pinyin/es/main.d.ts +4 -0
- package/types/pinyin/es/traditional.d.ts +4 -0
- package/types/snapdom/src/api/snapdom.d.ts +11 -79
- package/types/snapdom/src/exporters/toCanvas.d.ts +11 -3
- package/types/snapdom/src/exporters/toJpg.d.ts +1 -0
- package/types/snapdom/src/exporters/toPng.d.ts +6 -0
- package/types/snapdom/src/exporters/toSvg.d.ts +1 -0
- package/types/snapdom/src/exporters/toWebp.d.ts +1 -0
- package/types/snapdom/src/modules/iconFonts.d.ts +7 -20
- package/types/snapdom/src/modules/pseudo.d.ts +18 -0
- package/types/snapdom/src/modules/rasterize.d.ts +6 -10
- package/types/snapdom/src/utils/browser.d.ts +0 -3
- package/types/snapdom/src/utils/capture.helpers.d.ts +45 -0
- package/types/snapdom/src/utils/clone.helpers.d.ts +97 -0
- package/types/snapdom/src/utils/image.d.ts +0 -8
- package/types/snapdom/src/utils/index.d.ts +1 -1
- package/types/snapdom/src/utils/prepare.helpers.d.ts +9 -0
- package/types/snapdom/src/utils/transforms.helpers.d.ts +118 -0
- package/types/tree/index.d.ts +3 -4
- package/types/validate/src/index.d.ts +23 -25
- package/types/validate/src/interface.d.ts +5 -3
- package/types/validate/src/locale/en-US.d.ts +12 -2
- package/types/validate/src/locale/index.d.ts +171 -0
- package/types/validate/src/locale/zh-CN.d.ts +12 -2
- package/types/validate/src/rules/base.d.ts +3 -1
- package/types/validate/src/rules/custom.d.ts +1 -1
- package/types/validate/src/rules/type.d.ts +10 -0
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +8 -7
- package/uiColor.js +25 -24
- package/url-toolkit/index.js +1 -1
- package/url-toolkit/src/url-toolkit.js +1 -1
- package/urlToolkit.js +1 -1
- package/validate/index.js +23 -25
- package/validate/src/index.js +116 -73
- package/validate/src/locale/en-US.js +12 -2
- package/validate/src/locale/index.js +11 -0
- package/validate/src/locale/zh-CN.js +12 -2
- package/validate/src/rules/array.js +2 -2
- package/validate/src/rules/base.js +35 -31
- package/validate/src/rules/boolean.js +1 -1
- package/validate/src/rules/custom.js +2 -2
- package/validate/src/rules/number.js +1 -1
- package/validate/src/rules/object.js +1 -1
- package/validate/src/rules/string.js +6 -5
- package/validate/src/rules/type.js +84 -14
- package/validate.js +23 -25
- package/version/index.js +1 -1
- package/version.js +1 -1
- package/xlsx/index.d.ts +4 -8
- package/xlsx/index.js +1 -1
- package/xlsx/xlsx.js +2 -2
- package/xlsx.js +1 -1
- package/types/validate/src/message.d.ts +0 -2
- package/types/validate/src/utils.d.ts +0 -3
- package/validate/src/message.js +0 -5
- package/validate/src/utils.js +0 -8
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import { cache as y } from "../core/cache.js";
|
|
3
|
+
import { snapFetch as w } from "../modules/snapFetch.js";
|
|
4
|
+
import { inlineAllStyles as b } from "../modules/styles.js";
|
|
5
|
+
import { idle as S } from "./browser.js";
|
|
6
|
+
function _(t, r, n) {
|
|
7
|
+
return Promise.all(
|
|
8
|
+
t.map((e) => new Promise((i) => {
|
|
9
|
+
function a() {
|
|
10
|
+
S(
|
|
11
|
+
(o) => {
|
|
12
|
+
(o && typeof o.timeRemaining == "function" ? o.timeRemaining() > 0 : !0) ? r(e, i) : a();
|
|
13
|
+
},
|
|
14
|
+
{ fast: n }
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
a();
|
|
18
|
+
}))
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function A(t) {
|
|
22
|
+
return t = t.trim(), !t || /:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t) ? t : `${t}:not([data-sd-slotted])`;
|
|
23
|
+
}
|
|
24
|
+
function $(t, r, n = !0) {
|
|
25
|
+
return t.split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
26
|
+
if (e.startsWith(":where(") || e.startsWith("@")) return e;
|
|
27
|
+
const i = n ? A(e) : e;
|
|
28
|
+
return `:where(${r} ${i})`;
|
|
29
|
+
}).join(", ");
|
|
30
|
+
}
|
|
31
|
+
function N(t, r) {
|
|
32
|
+
return t ? (t = t.replace(/:host\(([^)]+)\)/g, (n, e) => `:where(${r}:is(${e.trim()}))`), t = t.replace(/:host\b/g, `:where(${r})`), t = t.replace(/:host-context\(([^)]+)\)/g, (n, e) => `:where(:where(${e.trim()}) ${r})`), t = t.replace(/::slotted\(([^)]+)\)/g, (n, e) => `:where(${r} ${e.trim()})`), t = t.replace(
|
|
33
|
+
/(^|})(\s*)([^@}{]+){/g,
|
|
34
|
+
(n, e, i, a) => {
|
|
35
|
+
const o = $(
|
|
36
|
+
a,
|
|
37
|
+
r,
|
|
38
|
+
/*excludeSlotted*/
|
|
39
|
+
!0
|
|
40
|
+
);
|
|
41
|
+
return `${e}${i}${o}{`;
|
|
42
|
+
}
|
|
43
|
+
), t) : "";
|
|
44
|
+
}
|
|
45
|
+
function k(t) {
|
|
46
|
+
return t.shadowScopeSeq = (t.shadowScopeSeq || 0) + 1, `s${t.shadowScopeSeq}`;
|
|
47
|
+
}
|
|
48
|
+
function F(t) {
|
|
49
|
+
let r = "";
|
|
50
|
+
try {
|
|
51
|
+
t.querySelectorAll("style").forEach((e) => {
|
|
52
|
+
r += (e.textContent || "") + `
|
|
53
|
+
`;
|
|
54
|
+
});
|
|
55
|
+
const n = t.adoptedStyleSheets || [];
|
|
56
|
+
for (const e of n)
|
|
57
|
+
try {
|
|
58
|
+
if (e && e.cssRules)
|
|
59
|
+
for (const i of e.cssRules) r += i.cssText + `
|
|
60
|
+
`;
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
return r;
|
|
66
|
+
}
|
|
67
|
+
function L(t, r, n) {
|
|
68
|
+
if (!r) return;
|
|
69
|
+
const e = document.createElement("style");
|
|
70
|
+
e.setAttribute("data-sd", n), e.textContent = r, t.insertBefore(e, t.firstChild || null);
|
|
71
|
+
}
|
|
72
|
+
function D(t, r) {
|
|
73
|
+
try {
|
|
74
|
+
const n = t.currentSrc || t.src || "";
|
|
75
|
+
if (!n) return;
|
|
76
|
+
r.setAttribute("src", n), r.removeAttribute("srcset"), r.removeAttribute("sizes"), r.loading = "eager", r.decoding = "sync";
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function j(t) {
|
|
81
|
+
const r = /* @__PURE__ */ new Set();
|
|
82
|
+
if (!t) return r;
|
|
83
|
+
const n = /var\(\s*(--[A-Za-z0-9_-]+)\b/g;
|
|
84
|
+
let e;
|
|
85
|
+
for (; e = n.exec(t); ) r.add(e[1]);
|
|
86
|
+
return r;
|
|
87
|
+
}
|
|
88
|
+
function C(t, r) {
|
|
89
|
+
try {
|
|
90
|
+
let e = getComputedStyle(t).getPropertyValue(r).trim();
|
|
91
|
+
if (e) return e;
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
let e = getComputedStyle(document.documentElement).getPropertyValue(r).trim();
|
|
96
|
+
if (e) return e;
|
|
97
|
+
} catch {
|
|
98
|
+
}
|
|
99
|
+
return "";
|
|
100
|
+
}
|
|
101
|
+
function z(t, r, n) {
|
|
102
|
+
const e = [];
|
|
103
|
+
for (const i of r) {
|
|
104
|
+
const a = C(t, i);
|
|
105
|
+
a && e.push(`${i}: ${a};`);
|
|
106
|
+
}
|
|
107
|
+
return e.length ? `${n}{${e.join("")}}
|
|
108
|
+
` : "";
|
|
109
|
+
}
|
|
110
|
+
function O(t) {
|
|
111
|
+
t && (t.nodeType === Node.ELEMENT_NODE && t.setAttribute("data-sd-slotted", ""), t.querySelectorAll && t.querySelectorAll("*").forEach((r) => r.setAttribute("data-sd-slotted", "")));
|
|
112
|
+
}
|
|
113
|
+
async function E(t, r = 3) {
|
|
114
|
+
const n = () => {
|
|
115
|
+
try {
|
|
116
|
+
return t.contentDocument || t.contentWindow?.document || null;
|
|
117
|
+
} catch {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
let e = n(), i = 0;
|
|
122
|
+
for (; i < r && (!e || !e.body && !e.documentElement); )
|
|
123
|
+
await new Promise((a) => setTimeout(a, 0)), e = n(), i++;
|
|
124
|
+
return e && (e.body || e.documentElement) ? e : null;
|
|
125
|
+
}
|
|
126
|
+
function v(t) {
|
|
127
|
+
const r = t.getBoundingClientRect();
|
|
128
|
+
let n = 0, e = 0, i = 0, a = 0;
|
|
129
|
+
try {
|
|
130
|
+
const s = getComputedStyle(t);
|
|
131
|
+
n = parseFloat(s.borderLeftWidth) || 0, e = parseFloat(s.borderRightWidth) || 0, i = parseFloat(s.borderTopWidth) || 0, a = parseFloat(s.borderBottomWidth) || 0;
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
const o = Math.max(0, Math.round(r.width - (n + e))), c = Math.max(0, Math.round(r.height - (i + a)));
|
|
135
|
+
return { contentWidth: o, contentHeight: c, rect: r };
|
|
136
|
+
}
|
|
137
|
+
function q(t, r, n) {
|
|
138
|
+
const e = t.createElement("style");
|
|
139
|
+
return e.setAttribute("data-sd-iframe-pin", ""), e.textContent = `html, body {margin: 0 !important;padding: 0 !important;width: ${r}px !important;height: ${n}px !important;min-width: ${r}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`, (t.head || t.documentElement).appendChild(e), () => {
|
|
140
|
+
try {
|
|
141
|
+
e.remove();
|
|
142
|
+
} catch {
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
async function V(t, r, n) {
|
|
147
|
+
const e = await E(t, 3);
|
|
148
|
+
if (!e) throw new Error("iframe document not accessible/ready");
|
|
149
|
+
const { contentWidth: i, contentHeight: a, rect: o } = v(t), c = n?.snap;
|
|
150
|
+
if (!c || typeof c.toPng != "function")
|
|
151
|
+
throw new Error("snapdom.toPng not available in iframe or window");
|
|
152
|
+
const s = { ...n, scale: 1 }, u = q(e, i, a);
|
|
153
|
+
let d;
|
|
154
|
+
try {
|
|
155
|
+
d = await c.toPng(e.documentElement, s);
|
|
156
|
+
} finally {
|
|
157
|
+
u();
|
|
158
|
+
}
|
|
159
|
+
d.style.display = "block", d.style.width = `${i}px`, d.style.height = `${a}px`;
|
|
160
|
+
const l = document.createElement("div");
|
|
161
|
+
return r.nodeMap.set(l, t), b(t, l, r, n), l.style.overflow = "hidden", l.style.display = "block", l.style.width || (l.style.width = `${Math.round(o.width)}px`), l.style.height || (l.style.height = `${Math.round(o.height)}px`), l.appendChild(d), l;
|
|
162
|
+
}
|
|
163
|
+
var f = /* @__PURE__ */ new Map();
|
|
164
|
+
async function h(t) {
|
|
165
|
+
if (y.resource?.has(t)) return y.resource.get(t);
|
|
166
|
+
if (f.has(t)) return f.get(t);
|
|
167
|
+
const r = (async () => {
|
|
168
|
+
const n = await w(t, { as: "dataURL", silent: !0 });
|
|
169
|
+
if (!n.ok || typeof n.data != "string")
|
|
170
|
+
throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);
|
|
171
|
+
return y.resource?.set(t, n.data), n.data;
|
|
172
|
+
})();
|
|
173
|
+
f.set(t, r);
|
|
174
|
+
try {
|
|
175
|
+
const n = await r;
|
|
176
|
+
return f.set(t, n), n;
|
|
177
|
+
} catch (n) {
|
|
178
|
+
throw f.delete(t), n;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
var B = /\bblob:[^)"'\s]+/g;
|
|
182
|
+
async function g(t) {
|
|
183
|
+
if (!t || t.indexOf("blob:") === -1) return t;
|
|
184
|
+
const r = Array.from(new Set(t.match(B) || []));
|
|
185
|
+
if (r.length === 0) return t;
|
|
186
|
+
let n = t;
|
|
187
|
+
for (const e of r)
|
|
188
|
+
try {
|
|
189
|
+
const i = await h(e);
|
|
190
|
+
n = n.split(e).join(i);
|
|
191
|
+
} catch {
|
|
192
|
+
}
|
|
193
|
+
return n;
|
|
194
|
+
}
|
|
195
|
+
function m(t) {
|
|
196
|
+
return typeof t == "string" && t.startsWith("blob:");
|
|
197
|
+
}
|
|
198
|
+
function R(t) {
|
|
199
|
+
return (t || "").split(",").map((r) => r.trim()).filter(Boolean).map((r) => {
|
|
200
|
+
const n = r.match(/^(\S+)(\s+.+)?$/);
|
|
201
|
+
return n ? { url: n[1], desc: n[2] || "" } : null;
|
|
202
|
+
}).filter(Boolean);
|
|
203
|
+
}
|
|
204
|
+
function x(t) {
|
|
205
|
+
return t.map((r) => r.desc ? `${r.url} ${r.desc.trim()}` : r.url).join(", ");
|
|
206
|
+
}
|
|
207
|
+
async function H(t) {
|
|
208
|
+
if (!t) return;
|
|
209
|
+
const r = t.querySelectorAll ? t.querySelectorAll("img") : [];
|
|
210
|
+
for (const o of r)
|
|
211
|
+
try {
|
|
212
|
+
const s = o.getAttribute("src") || o.currentSrc || "";
|
|
213
|
+
if (m(s)) {
|
|
214
|
+
const d = await h(s);
|
|
215
|
+
o.setAttribute("src", d);
|
|
216
|
+
}
|
|
217
|
+
const u = o.getAttribute("srcset");
|
|
218
|
+
if (u && u.includes("blob:")) {
|
|
219
|
+
const d = R(u);
|
|
220
|
+
let l = !1;
|
|
221
|
+
for (const p of d)
|
|
222
|
+
if (m(p.url))
|
|
223
|
+
try {
|
|
224
|
+
p.url = await h(p.url), l = !0;
|
|
225
|
+
} catch {
|
|
226
|
+
}
|
|
227
|
+
l && o.setAttribute("srcset", x(d));
|
|
228
|
+
}
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
const n = t.querySelectorAll ? t.querySelectorAll("image") : [];
|
|
232
|
+
for (const o of n)
|
|
233
|
+
try {
|
|
234
|
+
const c = "http://www.w3.org/1999/xlink", s = o.getAttribute("href") || o.getAttributeNS?.(c, "href");
|
|
235
|
+
if (m(s)) {
|
|
236
|
+
const u = await h(s);
|
|
237
|
+
o.setAttribute("href", u), o.removeAttributeNS?.(c, "href");
|
|
238
|
+
}
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
241
|
+
const e = t.querySelectorAll ? t.querySelectorAll("[style*='blob:']") : [];
|
|
242
|
+
for (const o of e)
|
|
243
|
+
try {
|
|
244
|
+
const c = o.getAttribute("style");
|
|
245
|
+
if (c && c.includes("blob:")) {
|
|
246
|
+
const s = await g(c);
|
|
247
|
+
o.setAttribute("style", s);
|
|
248
|
+
}
|
|
249
|
+
} catch {
|
|
250
|
+
}
|
|
251
|
+
const i = t.querySelectorAll ? t.querySelectorAll("style") : [];
|
|
252
|
+
for (const o of i)
|
|
253
|
+
try {
|
|
254
|
+
const c = o.textContent || "";
|
|
255
|
+
c.includes("blob:") && (o.textContent = await g(c));
|
|
256
|
+
} catch {
|
|
257
|
+
}
|
|
258
|
+
const a = ["poster"];
|
|
259
|
+
for (const o of a) {
|
|
260
|
+
const c = t.querySelectorAll ? t.querySelectorAll(`[${o}^='blob:']`) : [];
|
|
261
|
+
for (const s of c)
|
|
262
|
+
try {
|
|
263
|
+
const u = s.getAttribute(o);
|
|
264
|
+
m(u) && s.setAttribute(o, await h(u));
|
|
265
|
+
} catch {
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
export {
|
|
270
|
+
h as blobUrlToDataUrl,
|
|
271
|
+
z as buildSeedCustomPropsRule,
|
|
272
|
+
j as collectCustomPropsFromCSS,
|
|
273
|
+
F as extractShadowCSS,
|
|
274
|
+
D as freezeImgSrcset,
|
|
275
|
+
E as getAccessibleIframeDocument,
|
|
276
|
+
_ as idleCallback,
|
|
277
|
+
L as injectScopedStyle,
|
|
278
|
+
O as markSlottedSubtree,
|
|
279
|
+
k as nextShadowScopeId,
|
|
280
|
+
V as rasterizeIframe,
|
|
281
|
+
H as resolveBlobUrlsInTree,
|
|
282
|
+
N as rewriteShadowCSS
|
|
283
|
+
};
|
package/snapdom/src/utils/css.js
CHANGED
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
/* 2025-
|
|
2
|
-
import { cache as
|
|
3
|
-
import { snapFetch as
|
|
4
|
-
import { extractURL as
|
|
5
|
-
function f(t, o) {
|
|
6
|
-
if (!o || !t.width || !t.height)
|
|
7
|
-
return t;
|
|
8
|
-
const r = document.createElement("canvas");
|
|
9
|
-
r.width = t.width, r.height = t.height;
|
|
10
|
-
const n = r.getContext("2d");
|
|
11
|
-
return n.fillStyle = o, n.fillRect(0, 0, r.width, r.height), n.drawImage(t, 0, 0), r;
|
|
12
|
-
}
|
|
13
|
-
async function m(t, o = {}) {
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import { cache as a } from "../core/cache.js";
|
|
3
|
+
import { snapFetch as c } from "../modules/snapFetch.js";
|
|
4
|
+
import { extractURL as i, safeEncodeURI as u } from "./helpers.js";
|
|
5
|
+
async function f(t, o = {}) {
|
|
14
6
|
if (/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(
|
|
15
7
|
t
|
|
16
8
|
) || t.trim() === "none")
|
|
17
9
|
return t;
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
10
|
+
const e = i(t);
|
|
11
|
+
if (!e)
|
|
20
12
|
return t;
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
return
|
|
13
|
+
const r = u(e);
|
|
14
|
+
if (a.background.has(r)) {
|
|
15
|
+
const n = a.background.get(r);
|
|
16
|
+
return n ? `url("${n}")` : "none";
|
|
25
17
|
}
|
|
26
18
|
try {
|
|
27
|
-
const
|
|
19
|
+
const n = await c(r, {
|
|
28
20
|
as: "dataURL",
|
|
29
21
|
useProxy: o.useProxy
|
|
30
22
|
});
|
|
31
|
-
return
|
|
23
|
+
return n.ok ? (a.background.set(r, n.data), `url("${n.data}")`) : (a.background.set(r, null), "none");
|
|
32
24
|
} catch {
|
|
33
|
-
return
|
|
25
|
+
return a.background.set(r, null), "none";
|
|
34
26
|
}
|
|
35
27
|
}
|
|
36
28
|
export {
|
|
37
|
-
f as
|
|
38
|
-
m as inlineSingleBackgroundEntry
|
|
29
|
+
f as inlineSingleBackgroundEntry
|
|
39
30
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
function d(o) {
|
|
3
|
+
const t = getComputedStyle(o), n = t.outlineStyle, e = t.outlineWidth, r = t.borderStyle, i = t.borderWidth, l = n !== "none" && parseFloat(e) > 0, s = r === "none" || parseFloat(i) === 0;
|
|
4
|
+
l && s && (o.style.border = `${e} solid transparent`);
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
d as stabilizeLayout
|
|
8
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import { limitDecimals as v } from "./capture.helpers.js";
|
|
3
|
+
function X(e) {
|
|
4
|
+
const t = e.boxShadow || "";
|
|
5
|
+
if (!t || t === "none") return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
6
|
+
const a = t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map((o) => o.trim());
|
|
7
|
+
let i = 0, c = 0, r = 0, s = 0;
|
|
8
|
+
for (const o of a) {
|
|
9
|
+
const n = o.match(/-?\d+(\.\d+)?px/g)?.map((p) => parseFloat(p)) || [];
|
|
10
|
+
if (n.length < 2) continue;
|
|
11
|
+
const [l, m, f = 0, x = 0] = n, u = Math.abs(l) + f + x, h = Math.abs(m) + f + x;
|
|
12
|
+
c = Math.max(c, u + Math.max(l, 0)), s = Math.max(s, u + Math.max(-l, 0)), r = Math.max(r, h + Math.max(m, 0)), i = Math.max(i, h + Math.max(-m, 0));
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
top: Math.ceil(i),
|
|
16
|
+
right: Math.ceil(c),
|
|
17
|
+
bottom: Math.ceil(r),
|
|
18
|
+
left: Math.ceil(s)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function Y(e) {
|
|
22
|
+
const t = (e.filter || "").match(/blur\(\s*([0-9.]+)px\s*\)/), a = t ? Math.ceil(parseFloat(t[1]) || 0) : 0;
|
|
23
|
+
return { top: a, right: a, bottom: a, left: a };
|
|
24
|
+
}
|
|
25
|
+
function O(e) {
|
|
26
|
+
if ((e.outlineStyle || "none") === "none")
|
|
27
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
28
|
+
const t = Math.ceil(parseFloat(e.outlineWidth || "0") || 0);
|
|
29
|
+
return { top: t, right: t, bottom: t, left: t };
|
|
30
|
+
}
|
|
31
|
+
function P(e) {
|
|
32
|
+
const t = `${e.filter || ""} ${e.webkitFilter || ""}`.trim();
|
|
33
|
+
if (!t || t === "none")
|
|
34
|
+
return { bleed: { top: 0, right: 0, bottom: 0, left: 0 }, has: !1 };
|
|
35
|
+
const a = t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi) || [];
|
|
36
|
+
let i = 0, c = 0, r = 0, s = 0, o = !1;
|
|
37
|
+
for (const n of a) {
|
|
38
|
+
o = !0;
|
|
39
|
+
const l = n.match(/-?\d+(?:\.\d+)?px/gi)?.map((p) => parseFloat(p)) || [], [m = 0, f = 0, x = 0] = l, u = Math.abs(m) + x, h = Math.abs(f) + x;
|
|
40
|
+
c = Math.max(c, u + Math.max(m, 0)), s = Math.max(s, u + Math.max(-m, 0)), r = Math.max(r, h + Math.max(f, 0)), i = Math.max(i, h + Math.max(-f, 0));
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
bleed: {
|
|
44
|
+
top: v(i),
|
|
45
|
+
right: v(c),
|
|
46
|
+
bottom: v(r),
|
|
47
|
+
left: v(s)
|
|
48
|
+
},
|
|
49
|
+
has: o
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function T(e, t) {
|
|
53
|
+
if (!e || !t || !t.style) return null;
|
|
54
|
+
const a = getComputedStyle(e);
|
|
55
|
+
try {
|
|
56
|
+
t.style.transformOrigin = "0 0";
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
"translate" in t.style && (t.style.translate = "none"), "rotate" in t.style && (t.style.rotate = "none");
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
const i = a.transform || "none";
|
|
64
|
+
if (i === "none")
|
|
65
|
+
try {
|
|
66
|
+
const r = F(e);
|
|
67
|
+
if (r.a === 1 && r.b === 0 && r.c === 0 && r.d === 1)
|
|
68
|
+
return t.style.transform = "none", { a: 1, b: 0, c: 0, d: 1 };
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
const c = i.match(/^matrix\(\s*([^)]+)\)$/i);
|
|
72
|
+
if (c) {
|
|
73
|
+
const r = c[1].split(",").map((s) => parseFloat(s.trim()));
|
|
74
|
+
if (r.length === 6 && r.every(Number.isFinite)) {
|
|
75
|
+
const [s, o, n, l] = r, m = Math.sqrt(s * s + o * o) || 0;
|
|
76
|
+
let f = 0, x = 0, u = 0, h = 0, p = 0, d = 0;
|
|
77
|
+
m > 0 && (f = s / m, x = o / m, u = f * n + x * l, h = n - f * u, p = l - x * u, d = Math.sqrt(h * h + p * p) || 0, d > 0 ? u = u / d : u = 0);
|
|
78
|
+
const y = m, g = 0, b = u * d, M = d;
|
|
79
|
+
try {
|
|
80
|
+
t.style.transform = `matrix(${y}, ${g}, ${b}, ${M}, 0, 0)`;
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
return { a: y, b: g, c: b, d: M };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const r = String(i).trim();
|
|
88
|
+
return t.style.transform = r + " translate(0px, 0px) rotate(0deg)", null;
|
|
89
|
+
} catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function I(e, t, a, i, c) {
|
|
94
|
+
const r = a.a, s = a.b, o = a.c, n = a.d, l = a.e || 0, m = a.f || 0;
|
|
95
|
+
function f(y, g) {
|
|
96
|
+
let b = y - i, M = g - c, w = r * b + o * M, $ = s * b + n * M;
|
|
97
|
+
return w += i + l, $ += c + m, [w, $];
|
|
98
|
+
}
|
|
99
|
+
const x = [f(0, 0), f(e, 0), f(0, t), f(e, t)];
|
|
100
|
+
let u = 1 / 0, h = 1 / 0, p = -1 / 0, d = -1 / 0;
|
|
101
|
+
for (const [y, g] of x)
|
|
102
|
+
y < u && (u = y), g < h && (h = g), y > p && (p = y), g > d && (d = g);
|
|
103
|
+
return {
|
|
104
|
+
minX: u,
|
|
105
|
+
minY: h,
|
|
106
|
+
maxX: p,
|
|
107
|
+
maxY: d,
|
|
108
|
+
width: p - u,
|
|
109
|
+
height: d - h
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function B(e, t, a) {
|
|
113
|
+
const i = (e.transformOrigin || "0 0").trim().split(/\s+/), [c, r] = [i[0] || "0", i[1] || "0"], s = (o, n) => {
|
|
114
|
+
const l = o.toLowerCase();
|
|
115
|
+
return l === "left" || l === "top" ? 0 : l === "center" ? n / 2 : l === "right" || l === "bottom" ? n : l.endsWith("px") ? parseFloat(l) || 0 : l.endsWith("%") ? (parseFloat(l) || 0) * n / 100 : /^-?\d+(\.\d+)?$/.test(l) && parseFloat(l) || 0;
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
ox: s(c, t),
|
|
119
|
+
oy: s(r, a)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function W(e) {
|
|
123
|
+
const t = { rotate: "0deg", scale: null, translate: null }, a = typeof e.computedStyleMap == "function" ? e.computedStyleMap() : null;
|
|
124
|
+
if (a) {
|
|
125
|
+
const c = (n) => {
|
|
126
|
+
try {
|
|
127
|
+
return typeof a.has == "function" && !a.has(n) || typeof a.get != "function" ? null : a.get(n);
|
|
128
|
+
} catch {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
}, r = c("rotate");
|
|
132
|
+
if (r)
|
|
133
|
+
if (r.angle) {
|
|
134
|
+
const n = r.angle;
|
|
135
|
+
t.rotate = n.unit === "rad" ? n.value * 180 / Math.PI + "deg" : n.value + n.unit;
|
|
136
|
+
} else r.unit ? t.rotate = r.unit === "rad" ? r.value * 180 / Math.PI + "deg" : r.value + r.unit : t.rotate = String(r);
|
|
137
|
+
else {
|
|
138
|
+
const n = getComputedStyle(e);
|
|
139
|
+
t.rotate = n.rotate && n.rotate !== "none" ? n.rotate : "0deg";
|
|
140
|
+
}
|
|
141
|
+
const s = c("scale");
|
|
142
|
+
if (s) {
|
|
143
|
+
const n = "x" in s && s.x?.value != null ? s.x.value : Array.isArray(s) ? s[0]?.value : Number(s) || 1, l = "y" in s && s.y?.value != null ? s.y.value : Array.isArray(s) ? s[1]?.value : n;
|
|
144
|
+
t.scale = `${n} ${l}`;
|
|
145
|
+
} else {
|
|
146
|
+
const n = getComputedStyle(e);
|
|
147
|
+
t.scale = n.scale && n.scale !== "none" ? n.scale : null;
|
|
148
|
+
}
|
|
149
|
+
const o = c("translate");
|
|
150
|
+
if (o) {
|
|
151
|
+
const n = "x" in o && "value" in o.x ? o.x.value : Array.isArray(o) ? o[0]?.value : 0, l = "y" in o && "value" in o.y ? o.y.value : Array.isArray(o) ? o[1]?.value : 0, m = "x" in o && o.x?.unit ? o.x.unit : "px", f = "y" in o && o.y?.unit ? o.y.unit : "px";
|
|
152
|
+
t.translate = `${n}${m} ${l}${f}`;
|
|
153
|
+
} else {
|
|
154
|
+
const n = getComputedStyle(e);
|
|
155
|
+
t.translate = n.translate && n.translate !== "none" ? n.translate : null;
|
|
156
|
+
}
|
|
157
|
+
return t;
|
|
158
|
+
}
|
|
159
|
+
const i = getComputedStyle(e);
|
|
160
|
+
return t.rotate = i.rotate && i.rotate !== "none" ? i.rotate : "0deg", t.scale = i.scale && i.scale !== "none" ? i.scale : null, t.translate = i.translate && i.translate !== "none" ? i.translate : null, t;
|
|
161
|
+
}
|
|
162
|
+
var S = null;
|
|
163
|
+
function C() {
|
|
164
|
+
if (S) return S;
|
|
165
|
+
const e = document.createElement("div");
|
|
166
|
+
return e.id = "snapdom-measure-slot", e.setAttribute("aria-hidden", "true"), Object.assign(e.style, {
|
|
167
|
+
position: "absolute",
|
|
168
|
+
left: "-99999px",
|
|
169
|
+
top: "0px",
|
|
170
|
+
width: "0px",
|
|
171
|
+
height: "0px",
|
|
172
|
+
overflow: "hidden",
|
|
173
|
+
opacity: "0",
|
|
174
|
+
pointerEvents: "none",
|
|
175
|
+
contain: "size layout style"
|
|
176
|
+
}), document.documentElement.appendChild(e), S = e, e;
|
|
177
|
+
}
|
|
178
|
+
function D(e) {
|
|
179
|
+
const t = C(), a = document.createElement("div");
|
|
180
|
+
a.style.transformOrigin = "0 0", e.baseTransform && (a.style.transform = e.baseTransform), e.rotate && (a.style.rotate = e.rotate), e.scale && (a.style.scale = e.scale), e.translate && (a.style.translate = e.translate), t.appendChild(a);
|
|
181
|
+
const i = F(a);
|
|
182
|
+
return t.removeChild(a), i;
|
|
183
|
+
}
|
|
184
|
+
function k(e) {
|
|
185
|
+
const t = getComputedStyle(e), a = t.transform || "none";
|
|
186
|
+
if (a !== "none" && !/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(a)) return !0;
|
|
187
|
+
const c = t.rotate && t.rotate !== "none" && t.rotate !== "0deg", r = t.scale && t.scale !== "none" && t.scale !== "1", s = t.translate && t.translate !== "none" && t.translate !== "0px 0px";
|
|
188
|
+
return !!(c || r || s);
|
|
189
|
+
}
|
|
190
|
+
function F(e) {
|
|
191
|
+
const t = getComputedStyle(e).transform;
|
|
192
|
+
if (!t || t === "none") return new DOMMatrix();
|
|
193
|
+
try {
|
|
194
|
+
return new DOMMatrix(t);
|
|
195
|
+
} catch {
|
|
196
|
+
return new WebKitCSSMatrix(t);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
I as bboxWithOriginFull,
|
|
201
|
+
k as hasBBoxAffectingTransform,
|
|
202
|
+
F as matrixFromComputed,
|
|
203
|
+
T as normalizeRootTransforms,
|
|
204
|
+
X as parseBoxShadow,
|
|
205
|
+
Y as parseFilterBlur,
|
|
206
|
+
P as parseFilterDropShadows,
|
|
207
|
+
O as parseOutline,
|
|
208
|
+
B as parseTransformOriginPx,
|
|
209
|
+
W as readIndividualTransforms,
|
|
210
|
+
D as readTotalTransformMatrix
|
|
211
|
+
};
|
package/snapdom.js
CHANGED
package/string/index.js
CHANGED
package/string.js
CHANGED
package/tinycolor/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
2
|
import { cmykToRgb as e, convertDecimalToHex as t, convertHexToDecimal as a, hslToRgb as n, hsvToRgb as b, numberInputToObject as m, parseIntFromHex as T, rgbToCmyk as i, rgbToHex as g, rgbToHsl as p, rgbToHsv as l, rgbToRgb as s, rgbaToArgbHex as x, rgbaToHex as c } from "./src/conversion.js";
|
|
3
3
|
import { names as f } from "./src/css-color-names.js";
|
|
4
4
|
import { inputToRGB as u, isValidCSSUnit as H, stringInputToObject as y } from "./src/format-input.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
2
|
import { rgbToRgb as S, hsvToRgb as v, hslToRgb as E, cmykToRgb as F, convertHexToDecimal as A, parseIntFromHex as s } from "./conversion.js";
|
|
3
3
|
import { names as R } from "./css-color-names.js";
|
|
4
4
|
import { convertToPercentage as g, boundAlpha as T } from "./utils.js";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import t from "lodash/isUndefined.js";
|
|
2
3
|
import { TinyColor as e } from "./index.js";
|
|
3
|
-
import { convertToPercentage as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
r:
|
|
7
|
-
g:
|
|
8
|
-
b:
|
|
4
|
+
import { convertToPercentage as r } from "./utils.js";
|
|
5
|
+
function d(n, m) {
|
|
6
|
+
const o = {
|
|
7
|
+
r: r(n.r),
|
|
8
|
+
g: r(n.g),
|
|
9
|
+
b: r(n.b)
|
|
9
10
|
};
|
|
10
|
-
return n.a
|
|
11
|
+
return t(n.a) || (o.a = Number(n.a)), new e(o, m);
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function i() {
|
|
13
14
|
return new e({
|
|
14
15
|
r: Math.random(),
|
|
15
16
|
g: Math.random(),
|
|
@@ -17,6 +18,6 @@ function f() {
|
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
d as fromRatio,
|
|
22
|
+
i as legacyRandom
|
|
22
23
|
};
|
package/tinycolor/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
2
|
import { numberInputToObject as d, rgbToHsv as g, rgbToHsl as u, rgbToHex as b, rgbaToHex as m, rgbToCmyk as c } from "./conversion.js";
|
|
3
3
|
import { names as $ } from "./css-color-names.js";
|
|
4
4
|
import { inputToRGB as f } from "./format-input.js";
|