flet-box 0.0.0-stage → 1.0.2

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.
Files changed (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -2
  3. package/bin/cli.js +394 -0
  4. package/bin/commands/buildAndroid.js +200 -0
  5. package/bin/commands/buildIOS.js +237 -0
  6. package/bin/commands/create.js +406 -0
  7. package/bin/commands/createBundle.js +375 -0
  8. package/bin/commands/createComponent.js +115 -0
  9. package/bin/commands/createScreen.js +161 -0
  10. package/bin/commands/killServer.js +107 -0
  11. package/bin/commands/package.js +131 -0
  12. package/bin/commands/release.js +189 -0
  13. package/bin/commands/runBundle.js +62 -0
  14. package/bin/commands/runCloudflare.js +89 -0
  15. package/bin/commands/runNative.js +109 -0
  16. package/bin/commands/runServer.js +390 -0
  17. package/bin/ota/loader.js +361 -0
  18. package/bin/utils/bundleConfig.js +178 -0
  19. package/bin/utils/capacitor.js +137 -0
  20. package/bin/utils/colors.js +215 -0
  21. package/bin/utils/helpers.js +80 -0
  22. package/bin/utils/spinner.js +96 -0
  23. package/bin/utils/templates.js +1824 -0
  24. package/bin/utils/version.js +108 -0
  25. package/package.json +58 -4
  26. package/src/animations/AnimatedBox.js +607 -0
  27. package/src/animations/AnimatedText.js +105 -0
  28. package/src/animations/MatrixRain.js +220 -0
  29. package/src/animations/ParallaxBox.js +369 -0
  30. package/src/animations/animate.js +332 -0
  31. package/src/animations/index.js +25 -0
  32. package/src/app.js +41 -0
  33. package/src/assets/icon-1024-maskable.png +0 -0
  34. package/src/assets/icon-192-maskable.png +0 -0
  35. package/src/assets/icon-192.png +0 -0
  36. package/src/assets/icon-512-maskable.png +0 -0
  37. package/src/assets/icon-512.png +0 -0
  38. package/src/assets/logo.png +0 -0
  39. package/src/core/App.js +44 -0
  40. package/src/core/hmr-client.js +142 -0
  41. package/src/core/index.js +34 -0
  42. package/src/core/pwa.js +100 -0
  43. package/src/core/runApp.js +430 -0
  44. package/src/create-index.sh +237 -0
  45. package/src/fonts/MaterialIcons-Regular.woff2 +0 -0
  46. package/src/fonts/icons.css +23 -0
  47. package/src/index.d.ts +1930 -0
  48. package/src/index.js +288 -0
  49. package/src/navigations/AdaptiveScaffold.js +149 -0
  50. package/src/navigations/AppBar.js +331 -0
  51. package/src/navigations/BottomNavigation.js +298 -0
  52. package/src/navigations/CollapsibleSideBar.js +139 -0
  53. package/src/navigations/Drawer.js +333 -0
  54. package/src/navigations/DrawerItem.js +260 -0
  55. package/src/navigations/Router.js +475 -0
  56. package/src/navigations/Scaffold.js +537 -0
  57. package/src/navigations/Tabs.js +384 -0
  58. package/src/navigations/index.js +57 -0
  59. package/src/services/RamStore.js +213 -0
  60. package/src/services/Session.js +310 -0
  61. package/src/services/Storage.js +309 -0
  62. package/src/services/http.js +350 -0
  63. package/src/services/index.js +57 -0
  64. package/src/tools/animation.js +42 -0
  65. package/src/tools/array.js +95 -0
  66. package/src/tools/border.js +28 -0
  67. package/src/tools/clipboard.js +104 -0
  68. package/src/tools/color.js +329 -0
  69. package/src/tools/createList.js +215 -0
  70. package/src/tools/delay.js +55 -0
  71. package/src/tools/device.js +138 -0
  72. package/src/tools/dict.js +297 -0
  73. package/src/tools/dimensions.js +118 -0
  74. package/src/tools/filter.js +41 -0
  75. package/src/tools/flex.js +26 -0
  76. package/src/tools/gradient.js +34 -0
  77. package/src/tools/grid.js +57 -0
  78. package/src/tools/index.js +38 -0
  79. package/src/tools/mapList.js +107 -0
  80. package/src/tools/margin.js +93 -0
  81. package/src/tools/memo.js +60 -0
  82. package/src/tools/os.js +104 -0
  83. package/src/tools/padding.js +93 -0
  84. package/src/tools/print.js +69 -0
  85. package/src/tools/random.js +299 -0
  86. package/src/tools/ref.js +70 -0
  87. package/src/tools/rgba.js +4 -0
  88. package/src/tools/shadow.js +23 -0
  89. package/src/tools/string.js +85 -0
  90. package/src/tools/time.js +674 -0
  91. package/src/tools/transform.js +68 -0
  92. package/src/tools/transition.js +48 -0
  93. package/src/tools/useState.js +268 -0
  94. package/src/tools/uuid.js +42 -0
  95. package/src/utils/TextInputValidator.js +256 -0
  96. package/src/utils/composeUpdate.js +65 -0
  97. package/src/utils/getWidgetProps.js +35 -0
  98. package/src/utils/index.js +76 -0
  99. package/src/utils/markdownParser.js +368 -0
  100. package/src/utils/mediaTime.js +79 -0
  101. package/src/utils/navigation.js +263 -0
  102. package/src/utils/scriptInjector.js +73 -0
  103. package/src/utils/stackPosition.js +31 -0
  104. package/src/utils/stopWebRefresh.js +77 -0
  105. package/src/utils/styleInjector.js +38 -0
  106. package/src/utils/syntaxHighlight.js +339 -0
  107. package/src/utils/themes.js +347 -0
  108. package/src/utils/units.js +87 -0
  109. package/src/utils/visualEffects.js +169 -0
  110. package/src/widget-factory/addChildren.js +114 -0
  111. package/src/widget-factory/assignProps.js +256 -0
  112. package/src/widget-factory/createWidget.js +28 -0
  113. package/src/widget-factory/effects.js +132 -0
  114. package/src/widget-factory/index.js +7 -0
  115. package/src/widget-factory/lifecycle.js +210 -0
  116. package/src/widget-factory/makeParentable.js +89 -0
  117. package/src/widget-factory/pixTool.js +40 -0
  118. package/src/widget-factory/processProps.js +122 -0
  119. package/src/widget-factory/reactivity.js +98 -0
  120. package/src/widget-factory/remTool.js +34 -0
  121. package/src/widget-factory/stackPosition.js +87 -0
  122. package/src/widget-factory/stringTool.js +26 -0
  123. package/src/widget-factory/tools.js +249 -0
  124. package/src/widget-factory/translateProps.js +1049 -0
  125. package/src/widget-factory/warnings.js +284 -0
  126. package/src/widget-factory/widgetFactory.js +200 -0
  127. package/src/widgets/Accordion.js +562 -0
  128. package/src/widgets/AdMob.js +315 -0
  129. package/src/widgets/AdSense.js +268 -0
  130. package/src/widgets/AlertDialog.js +162 -0
  131. package/src/widgets/Audio.js +311 -0
  132. package/src/widgets/Avatar.js +210 -0
  133. package/src/widgets/Badge.js +189 -0
  134. package/src/widgets/BottomSheet.js +287 -0
  135. package/src/widgets/Button.js +247 -0
  136. package/src/widgets/Card.js +33 -0
  137. package/src/widgets/Carousel.js +301 -0
  138. package/src/widgets/Chart.js +632 -0
  139. package/src/widgets/Checkbox.js +106 -0
  140. package/src/widgets/Chip.js +153 -0
  141. package/src/widgets/CircularBar.js +352 -0
  142. package/src/widgets/CircularChart.js +549 -0
  143. package/src/widgets/CodeViewer.js +236 -0
  144. package/src/widgets/Column.js +29 -0
  145. package/src/widgets/Container.js +31 -0
  146. package/src/widgets/DataTable.js +257 -0
  147. package/src/widgets/Divider.js +93 -0
  148. package/src/widgets/DraggBox.js +115 -0
  149. package/src/widgets/Dropdown.js +505 -0
  150. package/src/widgets/DroppBox.js +180 -0
  151. package/src/widgets/FloatingActionButton.js +91 -0
  152. package/src/widgets/GridView.js +20 -0
  153. package/src/widgets/Icon.js +33 -0
  154. package/src/widgets/Image.js +15 -0
  155. package/src/widgets/Input.js +565 -0
  156. package/src/widgets/Inspector.js +254 -0
  157. package/src/widgets/InstallButton.js +110 -0
  158. package/src/widgets/ListTile.js +224 -0
  159. package/src/widgets/ListView.js +503 -0
  160. package/src/widgets/Markdown.js +1236 -0
  161. package/src/widgets/Modal.js +496 -0
  162. package/src/widgets/Pagination.js +195 -0
  163. package/src/widgets/ProgressBar.js +178 -0
  164. package/src/widgets/QRCode.js +467 -0
  165. package/src/widgets/Radio.js +132 -0
  166. package/src/widgets/Rating.js +261 -0
  167. package/src/widgets/Row.js +29 -0
  168. package/src/widgets/Skeleton.js +243 -0
  169. package/src/widgets/Slider.js +527 -0
  170. package/src/widgets/SnackBar.js +227 -0
  171. package/src/widgets/Stack.js +29 -0
  172. package/src/widgets/Stepper.js +296 -0
  173. package/src/widgets/Switch.js +102 -0
  174. package/src/widgets/Text.js +98 -0
  175. package/src/widgets/Tooltip.js +267 -0
  176. package/src/widgets/TreeView.js +370 -0
  177. package/src/widgets/Video.js +92 -0
  178. package/src/widgets/index.js +52 -0
@@ -0,0 +1,1049 @@
1
+ // core/translateProps.js
2
+ import { warnUnknownProp, setPropNames } from "./warnings.js";
3
+ /**
4
+ * CENTRAL PROP DATABASE
5
+ *
6
+ * This file defines every prop that the system understands.
7
+ * It is a pure data file – no processing logic here.
8
+ *
9
+ * Each entry:
10
+ * prop : custom name used in widgets (e.g., 'w', 'p', 'onClick')
11
+ * domProp : corresponding DOM property or CSS property
12
+ * type : 'style' | 'attribute' | 'event' | 'text' | 'special'
13
+ * unit : (optional) 'rem' | 'px' | 'none' – only for style props
14
+ * reactive : (optional) true/false – whether the prop is reactive
15
+ * targets : (optional) list of CSS DOM props a shorthand expands to
16
+ * (e.g. 'px' → paddingLeft + paddingRight). When absent the
17
+ * prop writes to its single `domProp`.
18
+ */
19
+
20
+ export const ALL_PROPS = [
21
+ // ==================== DIMENSIONS ====================
22
+ { prop: "w", domProp: "width", type: "style", unit: "rem", reactive: true },
23
+ {
24
+ prop: "width",
25
+ domProp: "width",
26
+ type: "style",
27
+ unit: "rem",
28
+ reactive: true,
29
+ },
30
+ { prop: "h", domProp: "height", type: "style", unit: "rem", reactive: true },
31
+ {
32
+ prop: "height",
33
+ domProp: "height",
34
+ type: "style",
35
+ unit: "rem",
36
+ reactive: true,
37
+ },
38
+ {
39
+ prop: "minW",
40
+ domProp: "minWidth",
41
+ type: "style",
42
+ unit: "rem",
43
+ reactive: true,
44
+ },
45
+ {
46
+ prop: "minWidth",
47
+ domProp: "minWidth",
48
+ type: "style",
49
+ unit: "rem",
50
+ reactive: true,
51
+ },
52
+ {
53
+ prop: "maxW",
54
+ domProp: "maxWidth",
55
+ type: "style",
56
+ unit: "rem",
57
+ reactive: true,
58
+ },
59
+ {
60
+ prop: "maxWidth",
61
+ domProp: "maxWidth",
62
+ type: "style",
63
+ unit: "rem",
64
+ reactive: true,
65
+ },
66
+ {
67
+ prop: "minH",
68
+ domProp: "minHeight",
69
+ type: "style",
70
+ unit: "rem",
71
+ reactive: true,
72
+ },
73
+ {
74
+ prop: "minHeight",
75
+ domProp: "minHeight",
76
+ type: "style",
77
+ unit: "rem",
78
+ reactive: true,
79
+ },
80
+ {
81
+ prop: "maxH",
82
+ domProp: "maxHeight",
83
+ type: "style",
84
+ unit: "rem",
85
+ reactive: true,
86
+ },
87
+ {
88
+ prop: "maxHeight",
89
+ domProp: "maxHeight",
90
+ type: "style",
91
+ unit: "rem",
92
+ reactive: true,
93
+ },
94
+
95
+ // ==================== SPACING ====================
96
+ { prop: "p", domProp: "padding", type: "style", unit: "rem", reactive: true },
97
+ {
98
+ prop: "padding",
99
+ domProp: "padding",
100
+ type: "style",
101
+ unit: "rem",
102
+ reactive: true,
103
+ },
104
+ { prop: "m", domProp: "margin", type: "style", unit: "rem", reactive: true },
105
+ {
106
+ prop: "margin",
107
+ domProp: "margin",
108
+ type: "style",
109
+ unit: "rem",
110
+ reactive: true,
111
+ },
112
+ {
113
+ prop: "pt",
114
+ domProp: "paddingTop",
115
+ type: "style",
116
+ unit: "rem",
117
+ reactive: true,
118
+ },
119
+ {
120
+ prop: "paddingTop",
121
+ domProp: "paddingTop",
122
+ type: "style",
123
+ unit: "rem",
124
+ reactive: true,
125
+ },
126
+ {
127
+ prop: "pr",
128
+ domProp: "paddingRight",
129
+ type: "style",
130
+ unit: "rem",
131
+ reactive: true,
132
+ },
133
+ {
134
+ prop: "paddingRight",
135
+ domProp: "paddingRight",
136
+ type: "style",
137
+ unit: "rem",
138
+ reactive: true,
139
+ },
140
+ {
141
+ prop: "pb",
142
+ domProp: "paddingBottom",
143
+ type: "style",
144
+ unit: "rem",
145
+ reactive: true,
146
+ },
147
+ {
148
+ prop: "paddingBottom",
149
+ domProp: "paddingBottom",
150
+ type: "style",
151
+ unit: "rem",
152
+ reactive: true,
153
+ },
154
+ {
155
+ prop: "pl",
156
+ domProp: "paddingLeft",
157
+ type: "style",
158
+ unit: "rem",
159
+ reactive: true,
160
+ },
161
+ {
162
+ prop: "paddingLeft",
163
+ domProp: "paddingLeft",
164
+ type: "style",
165
+ unit: "rem",
166
+ reactive: true,
167
+ },
168
+ {
169
+ prop: "mt",
170
+ domProp: "marginTop",
171
+ type: "style",
172
+ unit: "rem",
173
+ reactive: true,
174
+ },
175
+ {
176
+ prop: "marginTop",
177
+ domProp: "marginTop",
178
+ type: "style",
179
+ unit: "rem",
180
+ reactive: true,
181
+ },
182
+ {
183
+ prop: "mr",
184
+ domProp: "marginRight",
185
+ type: "style",
186
+ unit: "rem",
187
+ reactive: true,
188
+ },
189
+ {
190
+ prop: "marginRight",
191
+ domProp: "marginRight",
192
+ type: "style",
193
+ unit: "rem",
194
+ reactive: true,
195
+ },
196
+ {
197
+ prop: "mb",
198
+ domProp: "marginBottom",
199
+ type: "style",
200
+ unit: "rem",
201
+ reactive: true,
202
+ },
203
+ {
204
+ prop: "marginBottom",
205
+ domProp: "marginBottom",
206
+ type: "style",
207
+ unit: "rem",
208
+ reactive: true,
209
+ },
210
+ {
211
+ prop: "ml",
212
+ domProp: "marginLeft",
213
+ type: "style",
214
+ unit: "rem",
215
+ reactive: true,
216
+ },
217
+ {
218
+ prop: "marginLeft",
219
+ domProp: "marginLeft",
220
+ type: "style",
221
+ unit: "rem",
222
+ reactive: true,
223
+ },
224
+
225
+ // Shorthands (expand to both sides of an axis)
226
+ {
227
+ prop: "px",
228
+ domProp: "paddingLeft",
229
+ type: "style",
230
+ unit: "rem",
231
+ reactive: true,
232
+ targets: ["paddingLeft", "paddingRight"],
233
+ },
234
+ {
235
+ prop: "py",
236
+ domProp: "paddingTop",
237
+ type: "style",
238
+ unit: "rem",
239
+ reactive: true,
240
+ targets: ["paddingTop", "paddingBottom"],
241
+ },
242
+ {
243
+ prop: "mx",
244
+ domProp: "marginLeft",
245
+ type: "style",
246
+ unit: "rem",
247
+ reactive: true,
248
+ targets: ["marginLeft", "marginRight"],
249
+ },
250
+ {
251
+ prop: "my",
252
+ domProp: "marginTop",
253
+ type: "style",
254
+ unit: "rem",
255
+ reactive: true,
256
+ targets: ["marginTop", "marginBottom"],
257
+ },
258
+ { prop: "gap", domProp: "gap", type: "style", unit: "rem", reactive: true },
259
+
260
+ // ==================== POSITION ====================
261
+ {
262
+ prop: "pos",
263
+ domProp: "position",
264
+ type: "style",
265
+ unit: "none",
266
+ reactive: true,
267
+ },
268
+ {
269
+ prop: "position",
270
+ domProp: "position",
271
+ type: "style",
272
+ unit: "none",
273
+ reactive: true,
274
+ },
275
+ { prop: "z", domProp: "zIndex", type: "style", unit: "none", reactive: true },
276
+ {
277
+ prop: "zIndex",
278
+ domProp: "zIndex",
279
+ type: "style",
280
+ unit: "none",
281
+ reactive: true,
282
+ },
283
+ { prop: "top", domProp: "top", type: "style", unit: "rem", reactive: true },
284
+ {
285
+ prop: "right",
286
+ domProp: "right",
287
+ type: "style",
288
+ unit: "rem",
289
+ reactive: true,
290
+ },
291
+ {
292
+ prop: "bottom",
293
+ domProp: "bottom",
294
+ type: "style",
295
+ unit: "rem",
296
+ reactive: true,
297
+ },
298
+ { prop: "left", domProp: "left", type: "style", unit: "rem", reactive: true },
299
+ {
300
+ prop: "inset",
301
+ domProp: "inset",
302
+ type: "style",
303
+ unit: "rem",
304
+ reactive: true,
305
+ },
306
+
307
+ // ==================== COLORS ====================
308
+ {
309
+ prop: "bg",
310
+ domProp: "backgroundColor",
311
+ type: "style",
312
+ unit: "none",
313
+ reactive: true,
314
+ },
315
+ {
316
+ prop: "bgColor",
317
+ domProp: "backgroundColor",
318
+ type: "style",
319
+ unit: "none",
320
+ reactive: true,
321
+ },
322
+ {
323
+ prop: "backgroundColor",
324
+ domProp: "backgroundColor",
325
+ type: "style",
326
+ unit: "none",
327
+ reactive: true,
328
+ },
329
+ {
330
+ prop: "textColor",
331
+ domProp: "color",
332
+ type: "style",
333
+ unit: "none",
334
+ reactive: true,
335
+ },
336
+ {
337
+ prop: "color",
338
+ domProp: "color",
339
+ type: "style",
340
+ unit: "none",
341
+ reactive: true,
342
+ },
343
+ {
344
+ prop: "opacity",
345
+ domProp: "opacity",
346
+ type: "style",
347
+ unit: "none",
348
+ reactive: true,
349
+ },
350
+
351
+ // ==================== TEXT & TYPOGRAPHY ====================
352
+ { prop: "text", domProp: "textContent", type: "text", reactive: true },
353
+ { prop: "label", domProp: "textContent", type: "text", reactive: true },
354
+ { prop: "title", domProp: "textContent", type: "text", reactive: true },
355
+ { prop: "caption", domProp: "textContent", type: "text", reactive: true },
356
+ { prop: "description", domProp: "textContent", type: "text", reactive: true },
357
+ {
358
+ prop: "textContent",
359
+ domProp: "textContent",
360
+ type: "text",
361
+ // Not reactive on purpose: a reactive accessor would shadow the native
362
+ // DOM .textContent property (see reactivity.js NEVER_SHADOW).
363
+ reactive: false,
364
+ },
365
+ { prop: "message", domProp: "textContent", type: "text", reactive: true },
366
+ { prop: "buttonText", domProp: "textContent", type: "text", reactive: true },
367
+
368
+ {
369
+ prop: "size",
370
+ domProp: "fontSize",
371
+ type: "style",
372
+ unit: "rem",
373
+ reactive: true,
374
+ },
375
+ {
376
+ prop: "fontSize",
377
+ domProp: "fontSize",
378
+ type: "style",
379
+ unit: "rem",
380
+ reactive: true,
381
+ },
382
+ {
383
+ prop: "weight",
384
+ domProp: "fontWeight",
385
+ type: "style",
386
+ unit: "none",
387
+ reactive: true,
388
+ },
389
+ {
390
+ prop: "fontWeight",
391
+ domProp: "fontWeight",
392
+ type: "style",
393
+ unit: "none",
394
+ reactive: true,
395
+ },
396
+ {
397
+ prop: "textAlign",
398
+ domProp: "textAlign",
399
+ type: "style",
400
+ unit: "none",
401
+ reactive: true,
402
+ },
403
+ {
404
+ prop: "lineH",
405
+ domProp: "lineHeight",
406
+ type: "style",
407
+ unit: "none",
408
+ reactive: true,
409
+ },
410
+ {
411
+ prop: "lineHeight",
412
+ domProp: "lineHeight",
413
+ type: "style",
414
+ unit: "none",
415
+ reactive: true,
416
+ },
417
+ {
418
+ prop: "letterSpace",
419
+ domProp: "letterSpacing",
420
+ type: "style",
421
+ unit: "rem",
422
+ reactive: true,
423
+ },
424
+ {
425
+ prop: "letterSpacing",
426
+ domProp: "letterSpacing",
427
+ type: "style",
428
+ unit: "rem",
429
+ reactive: true,
430
+ },
431
+ {
432
+ prop: "textDecoration",
433
+ domProp: "textDecoration",
434
+ type: "style",
435
+ unit: "none",
436
+ reactive: true,
437
+ },
438
+ {
439
+ prop: "textTransform",
440
+ domProp: "textTransform",
441
+ type: "style",
442
+ unit: "none",
443
+ reactive: true,
444
+ },
445
+ {
446
+ prop: "whiteSpace",
447
+ domProp: "whiteSpace",
448
+ type: "style",
449
+ unit: "none",
450
+ reactive: true,
451
+ },
452
+ {
453
+ prop: "wordBreak",
454
+ domProp: "wordBreak",
455
+ type: "style",
456
+ unit: "none",
457
+ reactive: true,
458
+ },
459
+
460
+ // ==================== FLEXBOX ====================
461
+ {
462
+ prop: "direction",
463
+ domProp: "flexDirection",
464
+ type: "style",
465
+ unit: "none",
466
+ reactive: true,
467
+ },
468
+ {
469
+ prop: "flexDirection",
470
+ domProp: "flexDirection",
471
+ type: "style",
472
+ unit: "none",
473
+ reactive: true,
474
+ },
475
+ {
476
+ prop: "justify",
477
+ domProp: "justifyContent",
478
+ type: "style",
479
+ unit: "none",
480
+ reactive: true,
481
+ },
482
+ {
483
+ prop: "justifyContent",
484
+ domProp: "justifyContent",
485
+ type: "style",
486
+ unit: "none",
487
+ reactive: true,
488
+ },
489
+ {
490
+ prop: "align",
491
+ domProp: "alignItems",
492
+ type: "style",
493
+ unit: "none",
494
+ reactive: true,
495
+ },
496
+ {
497
+ prop: "alignItems",
498
+ domProp: "alignItems",
499
+ type: "style",
500
+ unit: "none",
501
+ reactive: true,
502
+ },
503
+ {
504
+ prop: "wrap",
505
+ domProp: "flexWrap",
506
+ type: "style",
507
+ unit: "none",
508
+ reactive: true,
509
+ },
510
+ {
511
+ prop: "flexWrap",
512
+ domProp: "flexWrap",
513
+ type: "style",
514
+ unit: "none",
515
+ reactive: true,
516
+ },
517
+ {
518
+ prop: "flex",
519
+ domProp: "flex",
520
+ type: "style",
521
+ unit: "none",
522
+ reactive: true,
523
+ },
524
+ {
525
+ prop: "flexGrow",
526
+ domProp: "flexGrow",
527
+ type: "style",
528
+ unit: "none",
529
+ reactive: true,
530
+ },
531
+ {
532
+ prop: "flexShrink",
533
+ domProp: "flexShrink",
534
+ type: "style",
535
+ unit: "none",
536
+ reactive: true,
537
+ },
538
+ {
539
+ prop: "flexBasis",
540
+ domProp: "flexBasis",
541
+ type: "style",
542
+ unit: "rem",
543
+ reactive: true,
544
+ },
545
+
546
+ // ==================== BORDERS & RADIUS ====================
547
+ {
548
+ prop: "rounded",
549
+ domProp: "borderRadius",
550
+ type: "style",
551
+ unit: "rem",
552
+ reactive: true,
553
+ },
554
+ {
555
+ prop: "borderRadius",
556
+ domProp: "borderRadius",
557
+ type: "style",
558
+ unit: "rem",
559
+ reactive: true,
560
+ },
561
+ {
562
+ prop: "border",
563
+ domProp: "border",
564
+ type: "style",
565
+ unit: "none",
566
+ reactive: true,
567
+ },
568
+ {
569
+ prop: "borderColor",
570
+ domProp: "borderColor",
571
+ type: "style",
572
+ unit: "none",
573
+ reactive: true,
574
+ },
575
+ {
576
+ prop: "borderWidth",
577
+ domProp: "borderWidth",
578
+ type: "style",
579
+ unit: "px",
580
+ reactive: true,
581
+ },
582
+ {
583
+ prop: "borderStyle",
584
+ domProp: "borderStyle",
585
+ type: "style",
586
+ unit: "none",
587
+ reactive: true,
588
+ },
589
+
590
+ // Corner shorthands (expand to both corners of a side)
591
+ {
592
+ prop: "roundedTop",
593
+ domProp: "borderTopLeftRadius",
594
+ type: "style",
595
+ unit: "rem",
596
+ reactive: true,
597
+ targets: ["borderTopLeftRadius", "borderTopRightRadius"],
598
+ },
599
+ {
600
+ prop: "roundedBottom",
601
+ domProp: "borderBottomLeftRadius",
602
+ type: "style",
603
+ unit: "rem",
604
+ reactive: true,
605
+ targets: ["borderBottomLeftRadius", "borderBottomRightRadius"],
606
+ },
607
+ {
608
+ prop: "roundedLeft",
609
+ domProp: "borderTopLeftRadius",
610
+ type: "style",
611
+ unit: "rem",
612
+ reactive: true,
613
+ targets: ["borderTopLeftRadius", "borderBottomLeftRadius"],
614
+ },
615
+ {
616
+ prop: "roundedRight",
617
+ domProp: "borderTopRightRadius",
618
+ type: "style",
619
+ unit: "rem",
620
+ reactive: true,
621
+ targets: ["borderTopRightRadius", "borderBottomRightRadius"],
622
+ },
623
+
624
+ // ==================== SHADOWS ====================
625
+ {
626
+ prop: "shadow",
627
+ domProp: "boxShadow",
628
+ type: "style",
629
+ unit: "none",
630
+ reactive: true,
631
+ },
632
+ {
633
+ prop: "boxShadow",
634
+ domProp: "boxShadow",
635
+ type: "style",
636
+ unit: "none",
637
+ reactive: true,
638
+ },
639
+ {
640
+ prop: "elevation",
641
+ domProp: "boxShadow",
642
+ type: "style",
643
+ unit: "none",
644
+ reactive: true,
645
+ }, // handled separately
646
+
647
+ // ==================== DISPLAY & LAYOUT ====================
648
+ {
649
+ prop: "display",
650
+ domProp: "display",
651
+ type: "style",
652
+ unit: "none",
653
+ reactive: true,
654
+ },
655
+ {
656
+ prop: "overflow",
657
+ domProp: "overflow",
658
+ type: "style",
659
+ unit: "none",
660
+ reactive: true,
661
+ },
662
+ {
663
+ prop: "overflowX",
664
+ domProp: "overflowX",
665
+ type: "style",
666
+ unit: "none",
667
+ reactive: true,
668
+ },
669
+ {
670
+ prop: "overflowY",
671
+ domProp: "overflowY",
672
+ type: "style",
673
+ unit: "none",
674
+ reactive: true,
675
+ },
676
+ {
677
+ prop: "boxSizing",
678
+ domProp: "boxSizing",
679
+ type: "style",
680
+ unit: "none",
681
+ reactive: true,
682
+ },
683
+ {
684
+ prop: "cursor",
685
+ domProp: "cursor",
686
+ type: "style",
687
+ unit: "none",
688
+ reactive: true,
689
+ },
690
+ {
691
+ prop: "visibility",
692
+ domProp: "visibility",
693
+ type: "style",
694
+ unit: "none",
695
+ reactive: true,
696
+ },
697
+ {
698
+ prop: "pointerEvents",
699
+ domProp: "pointerEvents",
700
+ type: "style",
701
+ unit: "none",
702
+ reactive: true,
703
+ },
704
+ {
705
+ prop: "userSelect",
706
+ domProp: "userSelect",
707
+ type: "style",
708
+ unit: "none",
709
+ reactive: true,
710
+ },
711
+
712
+ // ==================== BACKGROUND ====================
713
+ {
714
+ prop: "gradient",
715
+ domProp: "background",
716
+ type: "style",
717
+ unit: "none",
718
+ reactive: true,
719
+ },
720
+ {
721
+ prop: "bgImage",
722
+ domProp: "backgroundImage",
723
+ type: "style",
724
+ unit: "none",
725
+ reactive: true,
726
+ },
727
+ {
728
+ prop: "bgSize",
729
+ domProp: "backgroundSize",
730
+ type: "style",
731
+ unit: "none",
732
+ reactive: true,
733
+ },
734
+ {
735
+ prop: "bgPosition",
736
+ domProp: "backgroundPosition",
737
+ type: "style",
738
+ unit: "none",
739
+ reactive: true,
740
+ },
741
+ {
742
+ prop: "bgRepeat",
743
+ domProp: "backgroundRepeat",
744
+ type: "style",
745
+ unit: "none",
746
+ reactive: true,
747
+ },
748
+
749
+ // ==================== ANIMATIONS & TRANSITIONS ====================
750
+ {
751
+ prop: "transition",
752
+ domProp: "transition",
753
+ type: "style",
754
+ unit: "none",
755
+ reactive: true,
756
+ },
757
+ {
758
+ prop: "animation",
759
+ domProp: "animation",
760
+ type: "style",
761
+ unit: "none",
762
+ reactive: true,
763
+ },
764
+ {
765
+ prop: "transform",
766
+ domProp: "transform",
767
+ type: "style",
768
+ unit: "none",
769
+ reactive: true,
770
+ },
771
+
772
+ // ==================== HTML ATTRIBUTES ====================
773
+ { prop: "id", domProp: "id", type: "attribute" },
774
+ { prop: "className", domProp: "className", type: "attribute" },
775
+ { prop: "class", domProp: "className", type: "attribute" },
776
+ { prop: "name", domProp: "name", type: "attribute" },
777
+ { prop: "type", domProp: "type", type: "attribute" },
778
+ { prop: "href", domProp: "href", type: "attribute" },
779
+ { prop: "src", domProp: "src", type: "attribute" },
780
+ { prop: "alt", domProp: "alt", type: "attribute" },
781
+ { prop: "disabled", domProp: "disabled", type: "attribute" },
782
+ { prop: "readOnly", domProp: "readOnly", type: "attribute" },
783
+ { prop: "required", domProp: "required", type: "attribute" },
784
+ { prop: "checked", domProp: "checked", type: "attribute" },
785
+ { prop: "selected", domProp: "selected", type: "attribute" },
786
+ { prop: "placeholder", domProp: "placeholder", type: "attribute" },
787
+ { prop: "min", domProp: "min", type: "attribute" },
788
+ { prop: "max", domProp: "max", type: "attribute" },
789
+ { prop: "step", domProp: "step", type: "attribute" },
790
+ { prop: "pattern", domProp: "pattern", type: "attribute" },
791
+ { prop: "role", domProp: "role", type: "attribute" },
792
+ { prop: "lang", domProp: "lang", type: "attribute" },
793
+ { prop: "dir", domProp: "dir", type: "attribute" },
794
+ { prop: "tabIndex", domProp: "tabIndex", type: "attribute" },
795
+ { prop: "draggable", domProp: "draggable", type: "attribute" },
796
+ { prop: "hidden", domProp: "hidden", type: "attribute" },
797
+ { prop: "for", domProp: "htmlFor", type: "attribute" },
798
+ { prop: "htmlFor", domProp: "htmlFor", type: "attribute" },
799
+ { prop: "autofocus", domProp: "autofocus", type: "attribute" },
800
+ { prop: "autocomplete", domProp: "autocomplete", type: "attribute" },
801
+ { prop: "spellcheck", domProp: "spellcheck", type: "attribute" },
802
+
803
+ // ==================== EVENTS ====================
804
+ { prop: "onPress", domProp: "click", type: "event" },
805
+ { prop: "onClick", domProp: "click", type: "event" },
806
+ { prop: "onclick", domProp: "click", type: "event" }, // Lowercase alias
807
+ { prop: "onDoublePress", domProp: "dblclick", type: "event" },
808
+ { prop: "onRightClick", domProp: "contextmenu", type: "event" },
809
+ { prop: "onHover", domProp: "mouseenter", type: "event" },
810
+ { prop: "onHoverEnd", domProp: "mouseleave", type: "event" },
811
+ { prop: "onFocus", domProp: "focus", type: "event" },
812
+ { prop: "onBlur", domProp: "blur", type: "event" },
813
+ { prop: "onChange", domProp: "change", type: "event" },
814
+ { prop: "onInput", domProp: "input", type: "event" },
815
+ { prop: "onScroll", domProp: "scroll", type: "event" },
816
+ { prop: "onKeyDown", domProp: "keydown", type: "event" },
817
+ { prop: "onKeyUp", domProp: "keyup", type: "event" },
818
+ { prop: "onKeyPress", domProp: "keypress", type: "event" },
819
+ { prop: "onMouseDown", domProp: "mousedown", type: "event" },
820
+ { prop: "onMouseUp", domProp: "mouseup", type: "event" },
821
+ { prop: "onMouseMove", domProp: "mousemove", type: "event" },
822
+ { prop: "onTouchStart", domProp: "touchstart", type: "event" },
823
+ { prop: "onTouchMove", domProp: "touchmove", type: "event" },
824
+ { prop: "onTouchEnd", domProp: "touchend", type: "event" },
825
+
826
+ // ==================== SPECIAL (handled elsewhere) ====================
827
+ { prop: "ref", domProp: "ref", type: "special" },
828
+ { prop: "child", domProp: "child", type: "special" },
829
+ { prop: "children", domProp: "children", type: "special" },
830
+ // NOTE: there is intentionally no `style` prop. FletBox uses flat, aliased
831
+ // CSS props (backgroundColor, padding, flexDirection, ...). Passing
832
+ // `style: {...}` is rejected with a warning by processProps.
833
+
834
+ // ==================== ADDITIONAL SPECIALS (handled elsewhere) ====================
835
+ {
836
+ prop: "value",
837
+ domProp: "value",
838
+ type: "special",
839
+ reactive: true,
840
+ },
841
+ {
842
+ prop: "variant",
843
+ domProp: "variant",
844
+ type: "special",
845
+ reactive: true,
846
+ },
847
+
848
+ // ==================== AXIS SHORTHANDS (≡ px/py/mx/my) ====================
849
+ {
850
+ prop: "marginVertical",
851
+ domProp: "marginTop",
852
+ type: "style",
853
+ unit: "rem",
854
+ reactive: true,
855
+ targets: ["marginTop", "marginBottom"],
856
+ },
857
+ {
858
+ prop: "marginHorizontal",
859
+ domProp: "marginLeft",
860
+ type: "style",
861
+ unit: "rem",
862
+ reactive: true,
863
+ targets: ["marginLeft", "marginRight"],
864
+ },
865
+ {
866
+ prop: "paddingVertical",
867
+ domProp: "paddingTop",
868
+ type: "style",
869
+ unit: "rem",
870
+ reactive: true,
871
+ targets: ["paddingTop", "paddingBottom"],
872
+ },
873
+ {
874
+ prop: "paddingHorizontal",
875
+ domProp: "paddingLeft",
876
+ type: "style",
877
+ unit: "rem",
878
+ reactive: true,
879
+ targets: ["paddingLeft", "paddingRight"],
880
+ },
881
+
882
+ // ==================== EXTRA CSS (used by built-in widgets) ====================
883
+ {
884
+ prop: "fontFamily",
885
+ domProp: "fontFamily",
886
+ type: "style",
887
+ unit: "none",
888
+ reactive: true,
889
+ },
890
+ {
891
+ prop: "touchAction",
892
+ domProp: "touchAction",
893
+ type: "style",
894
+ unit: "none",
895
+ reactive: true,
896
+ },
897
+ {
898
+ prop: "textOverflow",
899
+ domProp: "textOverflow",
900
+ type: "style",
901
+ unit: "none",
902
+ reactive: true,
903
+ },
904
+ {
905
+ prop: "borderTop",
906
+ domProp: "borderTop",
907
+ type: "style",
908
+ unit: "none",
909
+ reactive: true,
910
+ },
911
+ {
912
+ prop: "borderBottom",
913
+ domProp: "borderBottom",
914
+ type: "style",
915
+ unit: "none",
916
+ reactive: true,
917
+ },
918
+ {
919
+ prop: "borderLeft",
920
+ domProp: "borderLeft",
921
+ type: "style",
922
+ unit: "none",
923
+ reactive: true,
924
+ },
925
+ {
926
+ prop: "borderRight",
927
+ domProp: "borderRight",
928
+ type: "style",
929
+ unit: "none",
930
+ reactive: true,
931
+ },
932
+
933
+ // ==================== INTERNAL CONTROL FLAGS (no DOM output) ====================
934
+ // Consumed by effects.js / widgets via _originalProps; never written to the DOM.
935
+ { prop: "disableTransform", domProp: "disableTransform", type: "special" },
936
+ { prop: "data", domProp: "data", type: "special" },
937
+
938
+ // Stack positioning shorthands, consumed by stackPosition.js from the widget's
939
+ // original props when `position: "stack"`. Registered here so they are not
940
+ // reported as unknown props; they write nothing to the DOM themselves.
941
+ { prop: "start", domProp: "start", type: "special" },
942
+ { prop: "end", domProp: "end", type: "special" },
943
+ { prop: "centerX", domProp: "centerX", type: "special" },
944
+ { prop: "centerY", domProp: "centerY", type: "special" },
945
+ { prop: "center", domProp: "center", type: "special" },
946
+ { prop: "fullWidth", domProp: "fullWidth", type: "special" },
947
+ { prop: "fullHeight", domProp: "fullHeight", type: "special" },
948
+ { prop: "full", domProp: "full", type: "special" },
949
+ ];
950
+
951
+ // ============================================================
952
+ // DERIVED MAPS
953
+ // ============================================================
954
+ /** Map: custom prop name → definition */
955
+ export const PROP_MAP = Object.fromEntries(ALL_PROPS.map((p) => [p.prop, p]));
956
+
957
+ /** Map: DOM property name → definition (useful for reverse lookups) */
958
+ export const DOM_PROP_MAP = Object.fromEntries(
959
+ ALL_PROPS.map((p) => [p.domProp, p]),
960
+ );
961
+
962
+ /** List of all style props (custom names) */
963
+ export const STYLE_PROPS = ALL_PROPS.filter((p) => p.type === "style").map(
964
+ (p) => p.prop,
965
+ );
966
+
967
+ /** List of all attribute props (custom names) */
968
+ export const ATTRIBUTE_PROPS = ALL_PROPS.filter(
969
+ (p) => p.type === "attribute",
970
+ ).map((p) => p.prop);
971
+
972
+ /** List of all event props (custom names) */
973
+ export const EVENT_PROPS = ALL_PROPS.filter((p) => p.type === "event").map(
974
+ (p) => p.prop,
975
+ );
976
+
977
+ /** List of all text props (custom names) */
978
+ export const TEXT_PROPS = ALL_PROPS.filter((p) => p.type === "text").map(
979
+ (p) => p.prop,
980
+ );
981
+
982
+ /** List of all reactive props (custom names) */
983
+ export const REACTIVE_PROPS = ALL_PROPS.filter((p) => p.reactive).map(
984
+ (p) => p.prop,
985
+ );
986
+
987
+ /** Map: DOM prop → unit for style props */
988
+ export const UNIT_MAP = Object.fromEntries(
989
+ ALL_PROPS.filter((p) => p.type === "style" && p.unit).map((p) => [
990
+ p.domProp,
991
+ p.unit,
992
+ ]),
993
+ );
994
+
995
+ /** Set of attribute DOM names (for quick membership checks) */
996
+ export const ATTRIBUTE_DOM_SET = new Set(
997
+ ALL_PROPS.filter((p) => p.type === "attribute").map((p) => p.domProp),
998
+ );
999
+
1000
+ /** Set of event DOM names */
1001
+ export const EVENT_DOM_SET = new Set(
1002
+ ALL_PROPS.filter((p) => p.type === "event").map((p) => p.domProp),
1003
+ );
1004
+
1005
+ /** Set of text custom names */
1006
+ export const TEXT_PROP_SET = new Set(TEXT_PROPS);
1007
+
1008
+ // ============================================================
1009
+ // LOOKUP FUNCTION WITH WARNING
1010
+ // ============================================================
1011
+ setPropNames(Object.keys(PROP_MAP));
1012
+
1013
+ /**
1014
+ * Looks up a prop definition by its custom name.
1015
+ *
1016
+ * Returns `null` and emits a warning (via `warnUnknownProp`) when the prop is
1017
+ * not registered. The `context` object is forwarded to the warning function to
1018
+ * allow widget-name–aware messages.
1019
+ *
1020
+ * @param {string} propName - The custom prop name to look up (e.g. `'w'`, `'onClick'`).
1021
+ * @param {Object} [context={}] - Optional context for warning messages
1022
+ * (e.g. `{ widgetName: 'Button' }`).
1023
+ * @returns {Object|null} The prop definition object from `ALL_PROPS`, or `null`
1024
+ * when the prop is unknown.
1025
+ */
1026
+ export function getPropDefinition(propName, context = {}) {
1027
+ const def = PROP_MAP[propName];
1028
+ if (!def) {
1029
+ warnUnknownProp(propName, context);
1030
+ return null;
1031
+ }
1032
+ return def;
1033
+ }
1034
+
1035
+ export default {
1036
+ ALL_PROPS,
1037
+ PROP_MAP,
1038
+ DOM_PROP_MAP,
1039
+ STYLE_PROPS,
1040
+ ATTRIBUTE_PROPS,
1041
+ EVENT_PROPS,
1042
+ TEXT_PROPS,
1043
+ REACTIVE_PROPS,
1044
+ UNIT_MAP,
1045
+ ATTRIBUTE_DOM_SET,
1046
+ EVENT_DOM_SET,
1047
+ TEXT_PROP_SET,
1048
+ getPropDefinition,
1049
+ };