@snailycfx/stylesheet 1.0.10
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/.vscode/settings.json +3 -0
- package/LICENSE +21 -0
- package/out/core/engine/absolute.d.ts +10 -0
- package/out/core/engine/absolute.d.ts.map +1 -0
- package/out/core/engine/absolute.luau +86 -0
- package/out/core/engine/flex.d.ts +14 -0
- package/out/core/engine/flex.d.ts.map +1 -0
- package/out/core/engine/flex.luau +284 -0
- package/out/core/engine/grid.d.ts +9 -0
- package/out/core/engine/grid.d.ts.map +1 -0
- package/out/core/engine/grid.luau +306 -0
- package/out/core/engine/index.d.ts +14 -0
- package/out/core/engine/index.d.ts.map +1 -0
- package/out/core/engine/init.luau +179 -0
- package/out/core/engine/node.d.ts +25 -0
- package/out/core/engine/node.d.ts.map +1 -0
- package/out/core/engine/node.luau +84 -0
- package/out/core/index.d.ts +16 -0
- package/out/core/index.d.ts.map +1 -0
- package/out/core/init.luau +21 -0
- package/out/core/parse/color.d.ts +3 -0
- package/out/core/parse/color.d.ts.map +1 -0
- package/out/core/parse/color.luau +22 -0
- package/out/core/parse/grid.d.ts +18 -0
- package/out/core/parse/grid.d.ts.map +1 -0
- package/out/core/parse/grid.luau +158 -0
- package/out/core/parse/index.d.ts +5 -0
- package/out/core/parse/index.d.ts.map +1 -0
- package/out/core/parse/init.luau +13 -0
- package/out/core/parse/udim.d.ts +5 -0
- package/out/core/parse/udim.d.ts.map +1 -0
- package/out/core/parse/udim.luau +53 -0
- package/out/core/types/RbxStyle.d.ts +17 -0
- package/out/core/types/RbxStyle.d.ts.map +1 -0
- package/out/core/types/RbxStyle.luau +2 -0
- package/out/core/types/index.d.ts +11 -0
- package/out/core/types/index.d.ts.map +1 -0
- package/out/core/types/init.luau +2 -0
- package/out/core/types/primitives.d.ts +7 -0
- package/out/core/types/primitives.d.ts.map +1 -0
- package/out/core/types/primitives.luau +2 -0
- package/out/core/types/style/background.d.ts +10 -0
- package/out/core/types/style/background.d.ts.map +1 -0
- package/out/core/types/style/background.luau +2 -0
- package/out/core/types/style/border.d.ts +8 -0
- package/out/core/types/style/border.d.ts.map +1 -0
- package/out/core/types/style/border.luau +2 -0
- package/out/core/types/style/index.d.ts +9 -0
- package/out/core/types/style/index.d.ts.map +1 -0
- package/out/core/types/style/init.luau +2 -0
- package/out/core/types/style/layout.d.ts +23 -0
- package/out/core/types/style/layout.d.ts.map +1 -0
- package/out/core/types/style/layout.luau +2 -0
- package/out/core/types/style/misc.d.ts +7 -0
- package/out/core/types/style/misc.d.ts.map +1 -0
- package/out/core/types/style/misc.luau +2 -0
- package/out/core/types/style/position.d.ts +11 -0
- package/out/core/types/style/position.d.ts.map +1 -0
- package/out/core/types/style/position.luau +2 -0
- package/out/core/types/style/size.d.ts +11 -0
- package/out/core/types/style/size.d.ts.map +1 -0
- package/out/core/types/style/size.luau +2 -0
- package/out/core/types/style/spacing.d.ts +21 -0
- package/out/core/types/style/spacing.d.ts.map +1 -0
- package/out/core/types/style/spacing.luau +2 -0
- package/out/core/types/style/text.d.ts +14 -0
- package/out/core/types/style/text.d.ts.map +1 -0
- package/out/core/types/style/text.luau +2 -0
- package/out/core/writer/index.d.ts +8 -0
- package/out/core/writer/index.d.ts.map +1 -0
- package/out/core/writer/init.luau +505 -0
- package/out/elements/index.d.ts +44 -0
- package/out/elements/index.d.ts.map +1 -0
- package/out/elements/init.luau +316 -0
- package/out/index.d.ts +11 -0
- package/out/index.d.ts.map +1 -0
- package/out/init.luau +19 -0
- package/out/stylesheet/index.d.ts +25 -0
- package/out/stylesheet/index.d.ts.map +1 -0
- package/out/stylesheet/init.luau +71 -0
- package/package.json +37 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type TrackUnit = {
|
|
2
|
+
type: "px";
|
|
3
|
+
value: number;
|
|
4
|
+
} | {
|
|
5
|
+
type: "fr";
|
|
6
|
+
value: number;
|
|
7
|
+
} | {
|
|
8
|
+
type: "percent";
|
|
9
|
+
value: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function parseGridTemplate(template: string): TrackUnit[];
|
|
12
|
+
export declare function resolveTrackSizes(tracks: TrackUnit[], containerSize: number, gap: number): number[];
|
|
13
|
+
export interface GridPlacement {
|
|
14
|
+
start: number | undefined;
|
|
15
|
+
span: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function parseGridPlacement(value: string): GridPlacement;
|
|
18
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../src/core/parse/grid.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAClB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAErC,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,CA2B/D;AAyBD,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,SAAS,EAAE,EACnB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,GACT,MAAM,EAAE,CA8BV;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAmB/D"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local expandRepeat
|
|
3
|
+
local function parseGridTemplate(template)
|
|
4
|
+
local tracks = {}
|
|
5
|
+
local expanded = expandRepeat((string.match((string.gsub(template, "%s+", " ")), "^%s*(.-)%s*$")))
|
|
6
|
+
for _, token in expanded do
|
|
7
|
+
local px = { string.match(token, "^(%d+%.?%d*)px$") }
|
|
8
|
+
if px ~= nil then
|
|
9
|
+
local _arg0 = {
|
|
10
|
+
type = "px",
|
|
11
|
+
value = tonumber(px[1]),
|
|
12
|
+
}
|
|
13
|
+
table.insert(tracks, _arg0)
|
|
14
|
+
continue
|
|
15
|
+
end
|
|
16
|
+
local fr = { string.match(token, "^(%d+%.?%d*)fr$") }
|
|
17
|
+
if fr ~= nil then
|
|
18
|
+
local _arg0 = {
|
|
19
|
+
type = "fr",
|
|
20
|
+
value = tonumber(fr[1]),
|
|
21
|
+
}
|
|
22
|
+
table.insert(tracks, _arg0)
|
|
23
|
+
continue
|
|
24
|
+
end
|
|
25
|
+
local pct = { string.match(token, "^(%d+%.?%d*)%%$") }
|
|
26
|
+
if pct ~= nil then
|
|
27
|
+
local _arg0 = {
|
|
28
|
+
type = "percent",
|
|
29
|
+
value = tonumber(pct[1]) / 100,
|
|
30
|
+
}
|
|
31
|
+
table.insert(tracks, _arg0)
|
|
32
|
+
continue
|
|
33
|
+
end
|
|
34
|
+
table.insert(tracks, {
|
|
35
|
+
type = "fr",
|
|
36
|
+
value = 1,
|
|
37
|
+
})
|
|
38
|
+
end
|
|
39
|
+
return tracks
|
|
40
|
+
end
|
|
41
|
+
function expandRepeat(template)
|
|
42
|
+
local result = template
|
|
43
|
+
-- Expandir repeat(N, track)
|
|
44
|
+
local matched = true
|
|
45
|
+
while matched do
|
|
46
|
+
matched = false
|
|
47
|
+
local rep = { string.match(result, "repeat%((%d+),%s*([^%)]+)%)") }
|
|
48
|
+
if rep ~= nil then
|
|
49
|
+
local count = tonumber(rep[1])
|
|
50
|
+
local track = rep[2]
|
|
51
|
+
local trackClean = (string.gsub(track, "%s", ""))
|
|
52
|
+
local parts = {}
|
|
53
|
+
do
|
|
54
|
+
local i = 0
|
|
55
|
+
local _shouldIncrement = false
|
|
56
|
+
while true do
|
|
57
|
+
if _shouldIncrement then
|
|
58
|
+
i += 1
|
|
59
|
+
else
|
|
60
|
+
_shouldIncrement = true
|
|
61
|
+
end
|
|
62
|
+
if not (i < count) then
|
|
63
|
+
break
|
|
64
|
+
end
|
|
65
|
+
table.insert(parts, trackClean)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
local expanded = table.concat(parts, " ")
|
|
69
|
+
local _result = result
|
|
70
|
+
local _arg0 = `repeat%(%d+,%s*[^%)]+%)`
|
|
71
|
+
result = (string.gsub(_result, _arg0, expanded, 1))
|
|
72
|
+
matched = true
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
local _exp = string.split(result, " ")
|
|
76
|
+
-- ▼ ReadonlyArray.filter ▼
|
|
77
|
+
local _newValue = {}
|
|
78
|
+
local _callback = function(t)
|
|
79
|
+
return #t > 0
|
|
80
|
+
end
|
|
81
|
+
local _length = 0
|
|
82
|
+
for _k, _v in _exp do
|
|
83
|
+
if _callback(_v, _k - 1, _exp) == true then
|
|
84
|
+
_length += 1
|
|
85
|
+
_newValue[_length] = _v
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
-- ▲ ReadonlyArray.filter ▲
|
|
89
|
+
return _newValue
|
|
90
|
+
end
|
|
91
|
+
local function resolveTrackSizes(tracks, containerSize, gap)
|
|
92
|
+
local totalGap = gap * math.max(0, #tracks - 1)
|
|
93
|
+
local remaining = containerSize - totalGap
|
|
94
|
+
local totalFr = 0
|
|
95
|
+
-- ▼ ReadonlyArray.map ▼
|
|
96
|
+
local _newValue = table.create(#tracks)
|
|
97
|
+
local _callback = function(track)
|
|
98
|
+
if track.type == "px" then
|
|
99
|
+
remaining -= track.value
|
|
100
|
+
return track.value
|
|
101
|
+
end
|
|
102
|
+
if track.type == "percent" then
|
|
103
|
+
local px = containerSize * track.value
|
|
104
|
+
remaining -= px
|
|
105
|
+
return px
|
|
106
|
+
end
|
|
107
|
+
totalFr += track.value
|
|
108
|
+
return 0
|
|
109
|
+
end
|
|
110
|
+
for _k, _v in tracks do
|
|
111
|
+
_newValue[_k] = _callback(_v, _k - 1, tracks)
|
|
112
|
+
end
|
|
113
|
+
-- ▲ ReadonlyArray.map ▲
|
|
114
|
+
local sizes = _newValue
|
|
115
|
+
if totalFr > 0 then
|
|
116
|
+
local frUnit = math.max(0, remaining) / totalFr
|
|
117
|
+
for i = 0, #sizes - 1 do
|
|
118
|
+
if tracks[i + 1].type == "fr" then
|
|
119
|
+
sizes[i + 1] = frUnit * tracks[i + 1].value
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
return sizes
|
|
124
|
+
end
|
|
125
|
+
local function parseGridPlacement(value)
|
|
126
|
+
local span = { string.match(value, "^span%s+(%d+)$") }
|
|
127
|
+
if span ~= nil then
|
|
128
|
+
return {
|
|
129
|
+
start = nil,
|
|
130
|
+
span = tonumber(span[1]),
|
|
131
|
+
}
|
|
132
|
+
end
|
|
133
|
+
local range = { string.match(value, "^(%d+)%s*/%s*(%d+)$") }
|
|
134
|
+
if range ~= nil then
|
|
135
|
+
local start = tonumber(range[1])
|
|
136
|
+
local endd = tonumber(range[2])
|
|
137
|
+
return {
|
|
138
|
+
start = start,
|
|
139
|
+
span = endd - start,
|
|
140
|
+
}
|
|
141
|
+
end
|
|
142
|
+
local single = { string.match(value, "^(%d+)$") }
|
|
143
|
+
if single ~= nil then
|
|
144
|
+
return {
|
|
145
|
+
start = tonumber(single[1]),
|
|
146
|
+
span = 1,
|
|
147
|
+
}
|
|
148
|
+
end
|
|
149
|
+
return {
|
|
150
|
+
start = nil,
|
|
151
|
+
span = 1,
|
|
152
|
+
}
|
|
153
|
+
end
|
|
154
|
+
return {
|
|
155
|
+
parseGridTemplate = parseGridTemplate,
|
|
156
|
+
resolveTrackSizes = resolveTrackSizes,
|
|
157
|
+
parseGridPlacement = parseGridPlacement,
|
|
158
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { parseColor } from "./color";
|
|
2
|
+
export { parseUDim, parseUDim2, resolvePixels } from "./udim";
|
|
3
|
+
export { parseGridTemplate, resolveTrackSizes, parseGridPlacement } from "./grid";
|
|
4
|
+
export type { TrackUnit, GridPlacement } from "./grid";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/parse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AACjF,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.parseColor = TS.import(script, script, "color").parseColor
|
|
5
|
+
local _udim = TS.import(script, script, "udim")
|
|
6
|
+
exports.parseUDim = _udim.parseUDim
|
|
7
|
+
exports.parseUDim2 = _udim.parseUDim2
|
|
8
|
+
exports.resolvePixels = _udim.resolvePixels
|
|
9
|
+
local _grid = TS.import(script, script, "grid")
|
|
10
|
+
exports.parseGridTemplate = _grid.parseGridTemplate
|
|
11
|
+
exports.resolveTrackSizes = _grid.resolveTrackSizes
|
|
12
|
+
exports.parseGridPlacement = _grid.parseGridPlacement
|
|
13
|
+
return exports
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UDimValue } from "../types";
|
|
2
|
+
export declare function parseUDim(value: UDimValue): UDim;
|
|
3
|
+
export declare function parseUDim2(x: UDimValue, y: UDimValue): UDim2;
|
|
4
|
+
export declare function resolvePixels(value: UDimValue, containerSize: number): number;
|
|
5
|
+
//# sourceMappingURL=udim.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function parseUDim(value)
|
|
3
|
+
local _value = value
|
|
4
|
+
if typeof(_value) == "number" then
|
|
5
|
+
return UDim.new(0, value)
|
|
6
|
+
end
|
|
7
|
+
local str = value
|
|
8
|
+
local mixed = { string.match(str, "^(%d+%.?%d*)%%([%+%-]%d+%.?%d*)$") }
|
|
9
|
+
if mixed ~= nil then
|
|
10
|
+
return UDim.new(tonumber(mixed[1]) / 100, tonumber(mixed[2]))
|
|
11
|
+
end
|
|
12
|
+
local scaleOnly = { string.match(str, "^(%d+%.?%d*)%%$") }
|
|
13
|
+
if scaleOnly ~= nil then
|
|
14
|
+
return UDim.new(tonumber(scaleOnly[1]) / 100, 0)
|
|
15
|
+
end
|
|
16
|
+
local _condition = tonumber(str)
|
|
17
|
+
if _condition == nil then
|
|
18
|
+
_condition = 0
|
|
19
|
+
end
|
|
20
|
+
return UDim.new(0, _condition)
|
|
21
|
+
end
|
|
22
|
+
local function parseUDim2(x, y)
|
|
23
|
+
local ux = parseUDim(x)
|
|
24
|
+
local uy = parseUDim(y)
|
|
25
|
+
return UDim2.new(ux.Scale, ux.Offset, uy.Scale, uy.Offset)
|
|
26
|
+
end
|
|
27
|
+
local function resolvePixels(value, containerSize)
|
|
28
|
+
local _value = value
|
|
29
|
+
if typeof(_value) == "number" then
|
|
30
|
+
return value
|
|
31
|
+
end
|
|
32
|
+
local str = value
|
|
33
|
+
local mixed = { string.match(str, "^(%d+%.?%d*)%%([%+%-]%d+%.?%d*)$") }
|
|
34
|
+
if mixed ~= nil then
|
|
35
|
+
local scale = tonumber(mixed[1]) / 100
|
|
36
|
+
local offset = tonumber(mixed[2])
|
|
37
|
+
return containerSize * scale + offset
|
|
38
|
+
end
|
|
39
|
+
local scaleOnly = { string.match(str, "^(%d+%.?%d*)%%$") }
|
|
40
|
+
if scaleOnly ~= nil then
|
|
41
|
+
return containerSize * (tonumber(scaleOnly[1]) / 100)
|
|
42
|
+
end
|
|
43
|
+
local _condition = tonumber(str)
|
|
44
|
+
if _condition == nil then
|
|
45
|
+
_condition = 0
|
|
46
|
+
end
|
|
47
|
+
return _condition
|
|
48
|
+
end
|
|
49
|
+
return {
|
|
50
|
+
parseUDim = parseUDim,
|
|
51
|
+
parseUDim2 = parseUDim2,
|
|
52
|
+
resolvePixels = resolvePixels,
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SpacingStyle } from "./style/spacing";
|
|
2
|
+
import type { SizeStyle } from "./style/size";
|
|
3
|
+
import type { BackgroundStyle } from "./style/background";
|
|
4
|
+
import type { BorderStyle } from "./style/border";
|
|
5
|
+
import type { TextStyle } from "./style/text";
|
|
6
|
+
import type { LayoutStyle } from "./style/layout";
|
|
7
|
+
import type { PositionStyle } from "./style/position";
|
|
8
|
+
import type { MiscStyle } from "./style/misc";
|
|
9
|
+
export interface RbxStyleBase extends SpacingStyle, SizeStyle, BackgroundStyle, BorderStyle, TextStyle, LayoutStyle, PositionStyle, MiscStyle {
|
|
10
|
+
}
|
|
11
|
+
export interface RbxStyle extends RbxStyleBase {
|
|
12
|
+
":hover"?: RbxStyleBase;
|
|
13
|
+
":active"?: RbxStyleBase;
|
|
14
|
+
":disabled"?: RbxStyleBase;
|
|
15
|
+
":focus"?: RbxStyleBase;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=RbxStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RbxStyle.d.ts","sourceRoot":"","sources":["../../../src/core/types/RbxStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,WAAW,YAAa,SAAQ,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS;CAAG;AAEhJ,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC7C,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAA;CACvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { UDimValue, ColorValue, GradientStop } from "./primitives";
|
|
2
|
+
export type { RbxStyle, RbxStyleBase } from "./RbxStyle";
|
|
3
|
+
export type { SpacingStyle } from "./style/spacing";
|
|
4
|
+
export type { SizeStyle } from "./style/size";
|
|
5
|
+
export type { BackgroundStyle } from "./style/background";
|
|
6
|
+
export type { BorderStyle } from "./style/border";
|
|
7
|
+
export type { TextStyle } from "./style/text";
|
|
8
|
+
export type { LayoutStyle, Display, FlexDirection, JustifyContent, AlignItems, AlignContent, FlexWrap } from "./style/layout";
|
|
9
|
+
export type { PositionStyle, PositionType } from "./style/position";
|
|
10
|
+
export type { MiscStyle } from "./style/misc";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACvE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC7H,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACnE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type UDimValue = number | `${number}%` | `${number}%+${number}` | `${number}%-${number}`;
|
|
2
|
+
export type ColorValue = string | [number, number, number] | Color3;
|
|
3
|
+
export interface GradientStop {
|
|
4
|
+
color: ColorValue;
|
|
5
|
+
position: number;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/core/types/primitives.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAClB,MAAM,GACN,GAAG,MAAM,GAAG,GACZ,GAAG,MAAM,KAAK,MAAM,EAAE,GACtB,GAAG,MAAM,KAAK,MAAM,EAAE,CAAA;AAEzB,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;AAEnE,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ColorValue, GradientStop } from "../primitives";
|
|
2
|
+
export interface BackgroundStyle {
|
|
3
|
+
backgroundColor?: ColorValue;
|
|
4
|
+
backgroundTransparency?: number;
|
|
5
|
+
backgroundGradient?: {
|
|
6
|
+
rotation?: number;
|
|
7
|
+
stops: GradientStop[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=background.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/background.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,WAAW,eAAe;IAC/B,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,YAAY,EAAE,CAAA;KACrB,CAAA;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"border.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/border.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,WAAW,WAAW;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { SpacingStyle } from "./spacing";
|
|
2
|
+
export type { SizeStyle } from "./size";
|
|
3
|
+
export type { BackgroundStyle } from "./background";
|
|
4
|
+
export type { BorderStyle } from "./border";
|
|
5
|
+
export type { TextStyle } from "./text";
|
|
6
|
+
export type { LayoutStyle, Display, FlexDirection, JustifyContent, AlignItems, AlignContent, FlexWrap } from "./layout";
|
|
7
|
+
export type { PositionStyle, PositionType } from "./position";
|
|
8
|
+
export type { MiscStyle } from "./misc";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACvH,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC7D,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Display = "flex" | "grid" | "none" | "block";
|
|
2
|
+
export type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
3
|
+
export type JustifyContent = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
4
|
+
export type AlignItems = "flex-start" | "center" | "flex-end" | "stretch";
|
|
5
|
+
export type AlignContent = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "stretch";
|
|
6
|
+
export type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
7
|
+
export interface LayoutStyle {
|
|
8
|
+
display?: Display;
|
|
9
|
+
flexDirection?: FlexDirection;
|
|
10
|
+
justifyContent?: JustifyContent;
|
|
11
|
+
alignItems?: AlignItems;
|
|
12
|
+
alignContent?: AlignContent;
|
|
13
|
+
flexWrap?: FlexWrap;
|
|
14
|
+
flex?: number;
|
|
15
|
+
flexGrow?: number;
|
|
16
|
+
flexShrink?: number;
|
|
17
|
+
flexBasis?: number | "auto";
|
|
18
|
+
gridTemplateColumns?: string;
|
|
19
|
+
gridTemplateRows?: string;
|
|
20
|
+
gridColumn?: string;
|
|
21
|
+
gridRow?: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/layout.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAE/E,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,eAAe,GACf,cAAc,GACd,cAAc,CAAA;AAEjB,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;AAEzE,MAAM,MAAM,YAAY,GACrB,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,eAAe,GACf,cAAc,GACd,cAAc,GACd,SAAS,CAAA;AAEZ,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAA;AAEzD,MAAM,WAAW,WAAW;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAE3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/misc.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC1C,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UDimValue } from "../primitives";
|
|
2
|
+
export type PositionType = "static" | "relative" | "absolute";
|
|
3
|
+
export interface PositionStyle {
|
|
4
|
+
position?: PositionType;
|
|
5
|
+
top?: UDimValue;
|
|
6
|
+
bottom?: UDimValue;
|
|
7
|
+
left?: UDimValue;
|
|
8
|
+
right?: UDimValue;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAA;AAE7D,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UDimValue } from "../primitives";
|
|
2
|
+
export interface SizeStyle {
|
|
3
|
+
width?: UDimValue;
|
|
4
|
+
height?: UDimValue;
|
|
5
|
+
minWidth?: UDimValue;
|
|
6
|
+
maxWidth?: UDimValue;
|
|
7
|
+
minHeight?: UDimValue;
|
|
8
|
+
maxHeight?: UDimValue;
|
|
9
|
+
aspectRatio?: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,WAAW,SAAS;IACzB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UDimValue } from "../primitives";
|
|
2
|
+
export interface SpacingStyle {
|
|
3
|
+
padding?: UDimValue;
|
|
4
|
+
paddingX?: UDimValue;
|
|
5
|
+
paddingY?: UDimValue;
|
|
6
|
+
paddingTop?: UDimValue;
|
|
7
|
+
paddingBottom?: UDimValue;
|
|
8
|
+
paddingLeft?: UDimValue;
|
|
9
|
+
paddingRight?: UDimValue;
|
|
10
|
+
margin?: UDimValue;
|
|
11
|
+
marginX?: UDimValue;
|
|
12
|
+
marginY?: UDimValue;
|
|
13
|
+
marginTop?: UDimValue;
|
|
14
|
+
marginBottom?: UDimValue;
|
|
15
|
+
marginLeft?: UDimValue;
|
|
16
|
+
marginRight?: UDimValue;
|
|
17
|
+
gap?: UDimValue;
|
|
18
|
+
rowGap?: UDimValue;
|
|
19
|
+
columnGap?: UDimValue;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=spacing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/spacing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,WAAW,YAAY;IAC5B,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,YAAY,CAAC,EAAE,SAAS,CAAA;IAExB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,WAAW,CAAC,EAAE,SAAS,CAAA;IAEvB,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;CACrB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColorValue } from "../primitives";
|
|
2
|
+
export interface TextStyle {
|
|
3
|
+
color?: ColorValue;
|
|
4
|
+
fontSize?: number;
|
|
5
|
+
fontFamily?: Enum.Font;
|
|
6
|
+
textAlign?: "left" | "center" | "right";
|
|
7
|
+
verticalAlign?: "top" | "center" | "bottom";
|
|
8
|
+
lineHeight?: number;
|
|
9
|
+
textTransparency?: number;
|
|
10
|
+
textScaled?: boolean;
|
|
11
|
+
textWrapped?: boolean;
|
|
12
|
+
textDecoration?: "none" | "underline" | "strikethrough";
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/core/types/style/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,WAAW,SAAS;IACzB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACvC,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,eAAe,CAAA;CACvD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RbxStyle } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Escribe propiedades visuales en una instancia.
|
|
4
|
+
* Solo escribe propiedades que hayan cambiado respecto al último estilo aplicado.
|
|
5
|
+
* NO escribe Position ni Size — responsabilidad del engine.
|
|
6
|
+
*/
|
|
7
|
+
export declare function writeVisual(instance: GuiObject, style: RbxStyle, prev?: RbxStyle): void;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/writer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAIxC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAKvF"}
|