@snailycfx/stylesheet 1.0.10 → 1.0.11

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.
@@ -40,5 +40,13 @@ export declare function video(props: BaseProps & {
40
40
  looped?: boolean;
41
41
  playing?: boolean;
42
42
  }): React.ReactElement;
43
+ export declare const Div: typeof div;
44
+ export declare const Span: typeof span;
45
+ export declare const Button: typeof button;
46
+ export declare const Img: typeof img;
47
+ export declare const Input: typeof input;
48
+ export declare const Ul: typeof ul;
49
+ export declare const Canvas: typeof canvas;
50
+ export declare const Video: typeof video;
43
51
  export {};
44
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/elements/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,cAAc,CAAA;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,SAAS,CAAA;AAUnD,UAAU,SAAS;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,gBAAiB,SAAQ,SAAS;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAgGD,wBAAgB,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAUxD;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAkBjG;AAED,wBA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AAG,YAAY,CAAA;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,KAAK,CAAC,YAAY,CA4BrB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAU3D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAmBjH;AAGD,eAAO,MAAM,GAAG,YAAM,CAAA;AACtB,eAAO,MAAM,IAAI,aAAO,CAAA;AACxB,eAAO,MAAM,MAAM,eAAS,CAAA;AAC5B,eAAO,MAAM,GAAG,YAAM,CAAA;AACtB,eAAO,MAAM,KAAK,cAAQ,CAAA;AAC1B,eAAO,MAAM,EAAE,WAAK,CAAA;AACpB,eAAO,MAAM,MAAM,eAAS,CAAA;AAC5B,eAAO,MAAM,KAAK,cAAQ,CAAA"}
@@ -29,17 +29,22 @@ local function useLayoutNode(ref, style, className, disabled)
29
29
  if not instance then
30
30
  return nil
31
31
  end
32
- -- Primer montaje
32
+ -- Primer montaje — esperar a que la instancia tenga AbsoluteSize real
33
33
  local node = createNode(instance, activeStyle, parentNode)
34
34
  nodeRef.current = node
35
35
  prevStyleRef.current = activeStyle
36
- -- Escribir visual inicial (sin prev — primera vez)
37
36
  writeVisual(instance, activeStyle)
38
- -- Layout
39
- runLayout(getRoot(node))
40
- -- Escuchar resize del contenedor
37
+ -- Si ya tiene tamaño, layout inmediato. Si no, esperar al primer resize
38
+ local doFirstLayout = function()
39
+ local size = instance.AbsoluteSize
40
+ if size.X > 0 or size.Y > 0 then
41
+ runLayout(getRoot(node))
42
+ end
43
+ end
44
+ doFirstLayout()
41
45
  local sizeConn = instance:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
42
- return runLayout(getRoot(node))
46
+ doFirstLayout()
47
+ runLayout(getRoot(node))
43
48
  end)
44
49
  -- Pseudo-estado :hover
45
50
  local connections = { sizeConn }
@@ -117,6 +122,7 @@ local function div(props)
117
122
  value = node,
118
123
  }, React.createElement("frame", {
119
124
  ref = ref,
125
+ Size = UDim2.fromScale(1, 1),
120
126
  BackgroundTransparency = 1,
121
127
  BorderSizePixel = 0,
122
128
  LayoutOrder = props.layoutOrder,
@@ -138,6 +144,7 @@ local function span(props)
138
144
  _condition_1 = false
139
145
  end
140
146
  _attributes.RichText = _condition_1
147
+ _attributes.Size = UDim2.fromScale(1, 1)
141
148
  _attributes.BackgroundTransparency = 1
142
149
  _attributes.BorderSizePixel = 0
143
150
  _attributes.LayoutOrder = props.layoutOrder
@@ -159,6 +166,7 @@ local function button(props)
159
166
  _attributes.Text = _condition
160
167
  _attributes.Active = not props.disabled
161
168
  _attributes.AutoButtonColor = false
169
+ _attributes.Size = UDim2.fromScale(1, 1)
162
170
  _attributes.BackgroundTransparency = 1
163
171
  _attributes.BorderSizePixel = 0
164
172
  _attributes.LayoutOrder = props.layoutOrder
@@ -205,6 +213,7 @@ local function img(props)
205
213
  ref = ref,
206
214
  Image = props.src,
207
215
  ScaleType = scaleTypeMap[props.scaleType or "fit"],
216
+ Size = UDim2.fromScale(1, 1),
208
217
  BackgroundTransparency = 1,
209
218
  BorderSizePixel = 0,
210
219
  LayoutOrder = props.layoutOrder,
@@ -231,6 +240,7 @@ local function input(props)
231
240
  _condition_2 = false
232
241
  end
233
242
  _attributes.ClearTextOnFocus = _condition_2
243
+ _attributes.Size = UDim2.fromScale(1, 1)
234
244
  _attributes.BackgroundTransparency = 1
235
245
  _attributes.BorderSizePixel = 0
236
246
  _attributes.LayoutOrder = props.layoutOrder
@@ -252,6 +262,7 @@ local function ul(props)
252
262
  local node = useLayoutNode(ref, props.style, props.className)
253
263
  local _attributes = {
254
264
  ref = ref,
265
+ Size = UDim2.fromScale(1, 1),
255
266
  BackgroundTransparency = 1,
256
267
  BorderSizePixel = 0,
257
268
  }
@@ -275,6 +286,7 @@ local function canvas(props)
275
286
  value = node,
276
287
  }, React.createElement("viewportframe", {
277
288
  ref = ref,
289
+ Size = UDim2.fromScale(1, 1),
278
290
  BackgroundTransparency = 1,
279
291
  BorderSizePixel = 0,
280
292
  LayoutOrder = props.layoutOrder,
@@ -297,6 +309,7 @@ local function video(props)
297
309
  _condition_1 = false
298
310
  end
299
311
  _attributes.Playing = _condition_1
312
+ _attributes.Size = UDim2.fromScale(1, 1)
300
313
  _attributes.BackgroundTransparency = 1
301
314
  _attributes.BorderSizePixel = 0
302
315
  _attributes.LayoutOrder = props.layoutOrder
@@ -304,6 +317,15 @@ local function video(props)
304
317
  value = node,
305
318
  }, React.createElement("videoframe", _attributes, props.children))
306
319
  end
320
+ -- Aliases PascalCase para uso como JSX components
321
+ local Div = div
322
+ local Span = span
323
+ local Button = button
324
+ local Img = img
325
+ local Input = input
326
+ local Ul = ul
327
+ local Canvas = canvas
328
+ local Video = video
307
329
  return {
308
330
  div = div,
309
331
  span = span,
@@ -313,4 +335,12 @@ return {
313
335
  ul = ul,
314
336
  canvas = canvas,
315
337
  video = video,
338
+ Div = Div,
339
+ Span = Span,
340
+ Button = Button,
341
+ Img = Img,
342
+ Input = Input,
343
+ Ul = Ul,
344
+ Canvas = Canvas,
345
+ Video = Video,
316
346
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snailycfx/stylesheet",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
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",