@snailycfx/stylesheet 1.0.11 → 1.0.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/core/parse/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAgBpD"}
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/core/parse/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAoBpD"}
@@ -14,7 +14,8 @@ local function parseColor(value)
14
14
  end
15
15
  local str = value
16
16
  local hex = (string.gsub(str, "#", ""))
17
- local expanded = if #hex == 3 then string.rep(string.sub(hex, 1, 1), 2) .. string.rep(string.sub(hex, 2, 2), 2) .. string.rep(string.sub(hex, 3, 3), 2) else hex
17
+ -- Expandir shorthand #rgb #rrggbb
18
+ local expanded = if #hex == 3 then string.rep(string.sub(hex, 1, 1), 2) .. string.rep(string.sub(hex, 2, 2), 2) .. string.rep(string.sub(hex, 3, 3), 2) elseif #hex == 8 then string.sub(hex, 1, 6) else hex
18
19
  return Color3.fromHex(expanded)
19
20
  end
20
21
  return {
@@ -1,5 +1,8 @@
1
1
  import type { UDimValue } from "../types";
2
2
  export declare function parseUDim(value: UDimValue): UDim;
3
3
  export declare function parseUDim2(x: UDimValue, y: UDimValue): UDim2;
4
+ /**
5
+ * Resuelve un UDimValue a píxeles absolutos dado el tamaño del contenedor.
6
+ */
4
7
  export declare function resolvePixels(value: UDimValue, containerSize: number): number;
5
8
  //# sourceMappingURL=udim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"udim.d.ts","sourceRoot":"","sources":["../../../src/core/parse/udim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAgBhD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,KAAK,CAI5D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAkB7E"}
1
+ {"version":3,"file":"udim.d.ts","sourceRoot":"","sources":["../../../src/core/parse/udim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAkBhD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,KAAK,CAI5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAkB7E"}
@@ -5,10 +5,12 @@ local function parseUDim(value)
5
5
  return UDim.new(0, value)
6
6
  end
7
7
  local str = value
8
+ -- "50%+16" o "50%-16"
8
9
  local mixed = { string.match(str, "^(%d+%.?%d*)%%([%+%-]%d+%.?%d*)$") }
9
10
  if mixed ~= nil then
10
11
  return UDim.new(tonumber(mixed[1]) / 100, tonumber(mixed[2]))
11
12
  end
13
+ -- "50%"
12
14
  local scaleOnly = { string.match(str, "^(%d+%.?%d*)%%$") }
13
15
  if scaleOnly ~= nil then
14
16
  return UDim.new(tonumber(scaleOnly[1]) / 100, 0)
@@ -24,6 +26,11 @@ local function parseUDim2(x, y)
24
26
  local uy = parseUDim(y)
25
27
  return UDim2.new(ux.Scale, ux.Offset, uy.Scale, uy.Offset)
26
28
  end
29
+ --[[
30
+ *
31
+ * Resuelve un UDimValue a píxeles absolutos dado el tamaño del contenedor.
32
+
33
+ ]]
27
34
  local function resolvePixels(value, containerSize)
28
35
  local _value = value
29
36
  if typeof(_value) == "number" then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snailycfx/stylesheet",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "CSS-inspired StyleSheet system for roblox-ts and @rbxts/react",
5
5
  "main": "out/init.lua",
6
6
  "types": "out/index.d.ts",