@leviosa-ai/detail-page-editor 0.3.0 → 0.3.1
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.
|
@@ -351,14 +351,20 @@ export function parseCssShadow(value: unknown): ParsedShadow | null {
|
|
|
351
351
|
if (typeof value !== "string") return null;
|
|
352
352
|
const trimmed = value.trim();
|
|
353
353
|
if (!trimmed || trimmed === "none") return null;
|
|
354
|
+
// 색 함수 안에 괄호를 허용하지 않는다(`[^()]` ). `[^)]` 이면 `rgb(rgb(rgb(…`
|
|
355
|
+
// 처럼 여는 괄호만 이어지는 값에서 시작점마다 끝까지 훑어 되짚기가 길이의 제곱으로
|
|
356
|
+
// 늘어난다 — 값은 문서에서 그대로 들어온다.
|
|
354
357
|
const colorMatch = trimmed.match(
|
|
355
|
-
/(rgba?\([^)]*\)|hsla?\([^)]*\)|#[0-9a-fA-F]{3,8})/,
|
|
358
|
+
/(rgba?\([^()]*\)|hsla?\([^()]*\)|#[0-9a-fA-F]{3,8})/,
|
|
356
359
|
);
|
|
357
360
|
const color = colorMatch ? colorMatch[0] : "#000000";
|
|
358
361
|
const rest = colorMatch ? trimmed.replace(colorMatch[0], " ") : trimmed;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
// 길이는 공백으로 끊어 토막마다 통째로 맞춰 본다. 이어 붙은 숫자열을 훑는
|
|
363
|
+
// 방식(`/-?\d+(?:\.\d+)?px/g`)은 `px` 가 끝내 안 나오는 숫자열에서 같은 제곱이 된다.
|
|
364
|
+
const lengths = rest
|
|
365
|
+
.split(/\s+/)
|
|
366
|
+
.filter((token) => /^-?\d+(?:\.\d+)?px$/.test(token))
|
|
367
|
+
.map((token) => parseFloat(token));
|
|
362
368
|
if (!lengths.length) return null;
|
|
363
369
|
const [offsetX = 0, offsetY = 0, blur = 0] = lengths;
|
|
364
370
|
return { color, offsetX, offsetY, blur };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leviosa-ai/detail-page-editor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Leviosa detail-page editor shell. Source-only: consumers compile it through Next transpilePackages. Every app coupling (sourcing server, brand store, cache keys, toast) arrives through the DetailPageHost interface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|