@v-ibe/core 0.1.0

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 (250) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/dist/DI/__tests__/scoped-container-dependencies.test.d.ts +1 -0
  4. package/dist/DI/bootstrap.d.ts +18 -0
  5. package/dist/DI/decorators/inject.d.ts +37 -0
  6. package/dist/DI/decorators/inject.js +45 -0
  7. package/dist/DI/decorators/service.d.ts +24 -0
  8. package/dist/DI/decorators/service.js +13 -0
  9. package/dist/DI/di-container.d.ts +53 -0
  10. package/dist/DI/di-container.js +158 -0
  11. package/dist/DI/lifecycle.d.ts +37 -0
  12. package/dist/DI/lifecycle.js +6 -0
  13. package/dist/DI/scoped-container.d.ts +68 -0
  14. package/dist/DI/scoped-container.js +193 -0
  15. package/dist/DI/service-metadata.d.ts +32 -0
  16. package/dist/DI/service-metadata.js +31 -0
  17. package/dist/DI/types.d.ts +4 -0
  18. package/dist/behaviors/__tests__/behavior-system.test.d.ts +1 -0
  19. package/dist/behaviors/behavior-manager.d.ts +60 -0
  20. package/dist/behaviors/behavior-manager.js +131 -0
  21. package/dist/behaviors/behavior-registry.d.ts +68 -0
  22. package/dist/behaviors/behavior-registry.js +105 -0
  23. package/dist/behaviors/constants.d.ts +16 -0
  24. package/dist/behaviors/constants.js +8 -0
  25. package/dist/behaviors/decorators.d.ts +87 -0
  26. package/dist/behaviors/decorators.js +46 -0
  27. package/dist/behaviors/index.d.ts +4 -0
  28. package/dist/components/__tests__/host.test.d.ts +1 -0
  29. package/dist/components/app-tree.d.ts +49 -0
  30. package/dist/components/app-tree.js +122 -0
  31. package/dist/components/base-component.d.ts +85 -0
  32. package/dist/components/base-component.js +438 -0
  33. package/dist/components/decorators/component.d.ts +27 -0
  34. package/dist/components/decorators/component.js +47 -0
  35. package/dist/components/decorators/prop.d.ts +14 -0
  36. package/dist/components/decorators/prop.js +37 -0
  37. package/dist/components/types.d.ts +26 -0
  38. package/dist/core.d.ts +23 -0
  39. package/dist/core.js +8 -0
  40. package/dist/custom-components/__tests__/for.test.d.ts +1 -0
  41. package/dist/custom-components/__tests__/show.test.d.ts +1 -0
  42. package/dist/custom-components/for.d.ts +58 -0
  43. package/dist/custom-components/for.js +313 -0
  44. package/dist/custom-components/index.d.ts +2 -0
  45. package/dist/custom-components/show.d.ts +78 -0
  46. package/dist/custom-components/show.js +88 -0
  47. package/dist/data-management/cache/cache-invalidate.decorator.d.ts +35 -0
  48. package/dist/data-management/cache/cache-invalidate.decorator.js +21 -0
  49. package/dist/data-management/cache/cache-metadata.d.ts +15 -0
  50. package/dist/data-management/cache/cache-provider.interface.d.ts +67 -0
  51. package/dist/data-management/cache/cache-tags.decorator.d.ts +52 -0
  52. package/dist/data-management/cache/cache-tags.decorator.js +13 -0
  53. package/dist/data-management/cache/cache-update.decorator.d.ts +28 -0
  54. package/dist/data-management/cache/cache-update.decorator.js +21 -0
  55. package/dist/data-management/cache/cache.decorator.d.ts +28 -0
  56. package/dist/data-management/cache/cache.decorator.js +13 -0
  57. package/dist/data-management/cache/index.d.ts +11 -0
  58. package/dist/data-management/cache/local-storage-cache.d.ts +40 -0
  59. package/dist/data-management/cache/local-storage-cache.js +268 -0
  60. package/dist/data-management/cache/memory-cache.d.ts +37 -0
  61. package/dist/data-management/cache/memory-cache.js +149 -0
  62. package/dist/data-management/cache/session-storage-cache.d.ts +35 -0
  63. package/dist/data-management/cache/session-storage-cache.js +242 -0
  64. package/dist/data-management/cache/ttl.decorator.d.ts +31 -0
  65. package/dist/data-management/cache/ttl.decorator.js +34 -0
  66. package/dist/data-management/decorators/consume.d.ts +29 -0
  67. package/dist/data-management/decorators/consume.js +28 -0
  68. package/dist/data-management/decorators/id.d.ts +28 -0
  69. package/dist/data-management/decorators/id.js +19 -0
  70. package/dist/data-management/decorators/model.d.ts +48 -0
  71. package/dist/data-management/decorators/model.js +24 -0
  72. package/dist/data-management/decorators/prop.d.ts +43 -0
  73. package/dist/data-management/decorators/prop.js +32 -0
  74. package/dist/data-management/index.d.ts +13 -0
  75. package/dist/data-management/store/json-to-model.d.ts +45 -0
  76. package/dist/data-management/store/json-to-model.js +36 -0
  77. package/dist/data-management/store/store.d.ts +108 -0
  78. package/dist/data-management/store/store.js +207 -0
  79. package/dist/data-management/store/types.d.ts +53 -0
  80. package/dist/events-handler/decorators/emit.d.ts +29 -0
  81. package/dist/events-handler/decorators/emit.js +51 -0
  82. package/dist/events-handler/event-decorators.d.ts +1 -0
  83. package/dist/events-handler/event-emitter.service.d.ts +21 -0
  84. package/dist/events-handler/event-emitter.service.js +85 -0
  85. package/dist/events-handler/event-types.d.ts +12 -0
  86. package/dist/index.d.ts +55 -0
  87. package/dist/index.js +121 -0
  88. package/dist/jsx/dynamic/__tests__/granular-array-renderer.test.d.ts +1 -0
  89. package/dist/jsx/dynamic/__tests__/jsx-array-rendering.test.d.ts +1 -0
  90. package/dist/jsx/dynamic/array-renderer.d.ts +2 -0
  91. package/dist/jsx/dynamic/array-renderer.js +133 -0
  92. package/dist/jsx/dynamic/child-renderer.d.ts +1 -0
  93. package/dist/jsx/dynamic/child-renderer.js +180 -0
  94. package/dist/jsx/dynamic/dom-utils.d.ts +5 -0
  95. package/dist/jsx/dynamic/dom-utils.js +22 -0
  96. package/dist/jsx/dynamic/granular-array-renderer.d.ts +16 -0
  97. package/dist/jsx/dynamic/granular-array-renderer.js +153 -0
  98. package/dist/jsx/dynamic/node-renderer.d.ts +2 -0
  99. package/dist/jsx/dynamic/props-handler.d.ts +3 -0
  100. package/dist/jsx/dynamic/props-handler.js +281 -0
  101. package/dist/jsx/dynamic/text-renderer.d.ts +2 -0
  102. package/dist/jsx/jsx-dev-runtime.d.ts +2 -0
  103. package/dist/jsx/jsx-runtime.d.ts +3 -0
  104. package/dist/jsx/types.d.ts +35 -0
  105. package/dist/jsx/types.js +4 -0
  106. package/dist/jsx-dev-runtime.d.ts +2 -0
  107. package/dist/jsx-dev-runtime.js +8 -0
  108. package/dist/jsx-runtime.d.ts +2 -0
  109. package/dist/jsx-runtime.js +11 -0
  110. package/dist/reactivity/__tests__/context-stack.test.d.ts +1 -0
  111. package/dist/reactivity/__tests__/nested-effects-untrack.test.d.ts +22 -0
  112. package/dist/reactivity/context-scope.d.ts +57 -0
  113. package/dist/reactivity/context-scope.js +35 -0
  114. package/dist/reactivity/decorators/__tests__/ctx-integration.test.d.ts +5 -0
  115. package/dist/reactivity/decorators/__tests__/ctx-loop.test.d.ts +10 -0
  116. package/dist/reactivity/decorators/__tests__/state-intelligent.test.d.ts +1 -0
  117. package/dist/reactivity/decorators/computed.d.ts +6 -0
  118. package/dist/reactivity/decorators/computed.js +17 -0
  119. package/dist/reactivity/decorators/create-event-decorator.d.ts +5 -0
  120. package/dist/reactivity/decorators/create-event-decorator.js +28 -0
  121. package/dist/reactivity/decorators/ctx.d.ts +9 -0
  122. package/dist/reactivity/decorators/ctx.js +91 -0
  123. package/dist/reactivity/decorators/effect.d.ts +9 -0
  124. package/dist/reactivity/decorators/effect.js +24 -0
  125. package/dist/reactivity/decorators/resource.d.ts +48 -0
  126. package/dist/reactivity/decorators/resource.js +20 -0
  127. package/dist/reactivity/decorators/state.d.ts +8 -0
  128. package/dist/reactivity/decorators/state.js +68 -0
  129. package/dist/reactivity/decorators/store.d.ts +6 -0
  130. package/dist/reactivity/decorators/store.js +25 -0
  131. package/dist/reactivity/phase-scheduler.d.ts +81 -0
  132. package/dist/reactivity/phase-scheduler.js +88 -0
  133. package/dist/reactivity/phase-scheduler.test.d.ts +1 -0
  134. package/dist/reactivity/reactive-cache.d.ts +21 -0
  135. package/dist/reactivity/reactive-cache.js +31 -0
  136. package/dist/reactivity/reactive-cache.test.d.ts +1 -0
  137. package/dist/reactivity/reactive-context.d.ts +152 -0
  138. package/dist/reactivity/reactive-context.js +184 -0
  139. package/dist/reactivity/signals/__tests__/composicion-automatica.test.d.ts +1 -0
  140. package/dist/reactivity/signals/__tests__/composite/nivel-1-estructura-basica.test.d.ts +1 -0
  141. package/dist/reactivity/signals/__tests__/composite/nivel-2-registro-subscribers.test.d.ts +1 -0
  142. package/dist/reactivity/signals/__tests__/composite/nivel-3-notificaciones-basicas.test.d.ts +1 -0
  143. package/dist/reactivity/signals/__tests__/composite/nivel-4-comparacion-valores.test.d.ts +1 -0
  144. package/dist/reactivity/signals/__tests__/composite/nivel-5-tracking-automatico.test.d.ts +1 -0
  145. package/dist/reactivity/signals/__tests__/composite/nivel-6-anti-glitch.test.d.ts +1 -0
  146. package/dist/reactivity/signals/__tests__/composite/nivel-7-objetos-anidados.test.d.ts +1 -0
  147. package/dist/reactivity/signals/__tests__/composite/nivel-8-observable-array-support.test.d.ts +1 -0
  148. package/dist/reactivity/signals/__tests__/composite-shallow-tracking.test.d.ts +1 -0
  149. package/dist/reactivity/signals/__tests__/effect.test.d.ts +1 -0
  150. package/dist/reactivity/signals/__tests__/reactive-array/nivel-1-estructura-basica.test.d.ts +1 -0
  151. package/dist/reactivity/signals/__tests__/reactive-array/nivel-2-metodos-mutadores.test.d.ts +1 -0
  152. package/dist/reactivity/signals/__tests__/reactive-array/nivel-3-tracking-por-indice.test.d.ts +1 -0
  153. package/dist/reactivity/signals/__tests__/reactive-array/nivel-4-tracking-length.test.d.ts +1 -0
  154. package/dist/reactivity/signals/__tests__/reactive-array/nivel-5-tracking-mutation.test.d.ts +1 -0
  155. package/dist/reactivity/signals/__tests__/reactive-array/nivel-6-metodos-no-mutadores.test.d.ts +1 -0
  156. package/dist/reactivity/signals/__tests__/reactive-array/nivel-7-composicion-bidireccional.test.d.ts +1 -0
  157. package/dist/reactivity/signals/__tests__/reactive-array/nivel-8-proxies.test.d.ts +1 -0
  158. package/dist/reactivity/signals/__tests__/reactive-array/nivel-9-derived-cache-optimization.test.d.ts +1 -0
  159. package/dist/reactivity/signals/__tests__/resource.test.d.ts +1 -0
  160. package/dist/reactivity/signals/__tests__/signal.test.d.ts +1 -0
  161. package/dist/reactivity/signals/array-strategies.d.ts +120 -0
  162. package/dist/reactivity/signals/array-strategies.js +261 -0
  163. package/dist/reactivity/signals/composite.d.ts +89 -0
  164. package/dist/reactivity/signals/composite.js +145 -0
  165. package/dist/reactivity/signals/computed.d.ts +61 -0
  166. package/dist/reactivity/signals/computed.js +107 -0
  167. package/dist/reactivity/signals/computed.test.d.ts +1 -0
  168. package/dist/reactivity/signals/derived.d.ts +10 -0
  169. package/dist/reactivity/signals/derived.js +24 -0
  170. package/dist/reactivity/signals/effect.d.ts +27 -0
  171. package/dist/reactivity/signals/effect.js +46 -0
  172. package/dist/reactivity/signals/event.d.ts +9 -0
  173. package/dist/reactivity/signals/event.js +15 -0
  174. package/dist/reactivity/signals/reactive-array.d.ts +133 -0
  175. package/dist/reactivity/signals/reactive-array.js +490 -0
  176. package/dist/reactivity/signals/reactive-proxy.d.ts +54 -0
  177. package/dist/reactivity/signals/reactive-proxy.js +299 -0
  178. package/dist/reactivity/signals/reactive-tracking.test.d.ts +1 -0
  179. package/dist/reactivity/signals/resource.d.ts +9 -0
  180. package/dist/reactivity/signals/resource.js +58 -0
  181. package/dist/reactivity/signals/signal.d.ts +39 -0
  182. package/dist/reactivity/signals/signal.js +56 -0
  183. package/dist/reactivity/signals/subscription-management.test.d.ts +1 -0
  184. package/dist/reactivity/types.d.ts +12 -0
  185. package/dist/router/__tests__/link-behavior-active-class.test.d.ts +1 -0
  186. package/dist/router/__tests__/loop-detector.test.d.ts +1 -0
  187. package/dist/router/__tests__/params-container-resolution.test.d.ts +1 -0
  188. package/dist/router/__tests__/router-generated-routes.test.d.ts +1 -0
  189. package/dist/router/__tests__/router-params-granular.test.d.ts +1 -0
  190. package/dist/router/__tests__/router-params-simple.test.d.ts +1 -0
  191. package/dist/router/__tests__/router-query-params.test.d.ts +1 -0
  192. package/dist/router/__tests__/router-route-candidates.test.d.ts +1 -0
  193. package/dist/router/__tests__/routeview-app-articles.test.d.ts +1 -0
  194. package/dist/router/__tests__/routeview-debug.test.d.ts +1 -0
  195. package/dist/router/__tests__/routeview-integration.test.d.ts +1 -0
  196. package/dist/router/__tests__/routeview-this.test.d.ts +1 -0
  197. package/dist/router/decorators/base-policy.d.ts +141 -0
  198. package/dist/router/decorators/base-policy.js +63 -0
  199. package/dist/router/decorators/index.d.ts +6 -0
  200. package/dist/router/decorators/params.d.ts +31 -0
  201. package/dist/router/decorators/params.js +97 -0
  202. package/dist/router/decorators/route-metadata.d.ts +11 -0
  203. package/dist/router/decorators/route-metadata.js +23 -0
  204. package/dist/router/decorators/route.d.ts +39 -0
  205. package/dist/router/decorators/route.js +7 -0
  206. package/dist/router/link.behavior.d.ts +87 -0
  207. package/dist/router/link.behavior.js +227 -0
  208. package/dist/router/policy-evaluator.d.ts +81 -0
  209. package/dist/router/policy-evaluator.js +209 -0
  210. package/dist/router/route-view.d.ts +56 -0
  211. package/dist/router/route-view.js +156 -0
  212. package/dist/router/router.d.ts +67 -0
  213. package/dist/router/router.js +308 -0
  214. package/dist/router/static-analysis/index.d.ts +37 -0
  215. package/dist/router/static-analysis/parser.d.ts +14 -0
  216. package/dist/router/static-analysis/parser.js +147 -0
  217. package/dist/router/static-analysis/scanner.d.ts +27 -0
  218. package/dist/router/static-analysis/scanner.js +91 -0
  219. package/dist/router/trie.d.ts +14 -0
  220. package/dist/router/trie.js +126 -0
  221. package/dist/router/trie.types.d.ts +36 -0
  222. package/dist/styles/base-style-sheet.d.ts +96 -0
  223. package/dist/styles/base-style-sheet.js +149 -0
  224. package/dist/styles/decorators/factories.d.ts +76 -0
  225. package/dist/styles/decorators/factories.js +11 -0
  226. package/dist/styles/decorators/keyframes.d.ts +238 -0
  227. package/dist/styles/decorators/keyframes.js +79 -0
  228. package/dist/styles/decorators/rule.d.ts +177 -0
  229. package/dist/styles/decorators/rule.js +72 -0
  230. package/dist/styles/decorators/scope.d.ts +66 -0
  231. package/dist/styles/decorators/scope.js +17 -0
  232. package/dist/styles/decorators/style.d.ts +1 -0
  233. package/dist/styles/decorators/style.js +20 -0
  234. package/dist/styles/decorators/useStyles.d.ts +5 -0
  235. package/dist/styles/decorators/useStyles.js +29 -0
  236. package/dist/styles/global-styles-registry.d.ts +72 -0
  237. package/dist/styles/global-styles-registry.js +155 -0
  238. package/dist/types.d.ts +1 -0
  239. package/dist/vite-plugins/__tests__/jsx-control-flow-transform.test.d.ts +1 -0
  240. package/dist/vite-plugins/index.d.ts +4 -0
  241. package/dist/vite-plugins/index.js +10 -0
  242. package/dist/vite-plugins/jsx-contextual.d.ts +7 -0
  243. package/dist/vite-plugins/jsx-contextual.js +53 -0
  244. package/dist/vite-plugins/jsx-control-flow-transform.d.ts +60 -0
  245. package/dist/vite-plugins/jsx-control-flow-transform.js +180 -0
  246. package/dist/vite-plugins/jsx-signals.d.ts +2 -0
  247. package/dist/vite-plugins/jsx-signals.js +124 -0
  248. package/dist/vite-plugins/router/route-generator-plugin.d.ts +63 -0
  249. package/dist/vite-plugins/router/route-generator-plugin.js +310 -0
  250. package/package.json +85 -0
@@ -0,0 +1,281 @@
1
+ import { isSignal } from "../../reactivity/signals/signal.js";
2
+ import { effect } from "../../reactivity/signals/effect.js";
3
+ import { isCustomElement } from "./dom-utils.js";
4
+ function bindProps(el, props, behaviorManager) {
5
+ let domProps = props;
6
+ if (behaviorManager) {
7
+ const consumed = behaviorManager.attachBehaviors(el, props);
8
+ if (consumed.size > 0) {
9
+ domProps = Object.fromEntries(
10
+ Object.entries(props).filter(([key]) => !consumed.has(key))
11
+ );
12
+ }
13
+ }
14
+ Object.entries(domProps).forEach(([key, value]) => {
15
+ bindSingleProp(el, key, value);
16
+ });
17
+ }
18
+ function bindSingleProp(el, key, value) {
19
+ if (key === "ref") {
20
+ bindRefProp(el, value);
21
+ return;
22
+ }
23
+ if (isEventProp(key)) {
24
+ bindEventProp(el, key, value);
25
+ return;
26
+ }
27
+ if (key === "className") {
28
+ bindClassNameProp(el, value);
29
+ return;
30
+ }
31
+ if (key === "style") {
32
+ bindStyleProp(el, value);
33
+ return;
34
+ }
35
+ if (isSignal(value)) {
36
+ bindSignalProp(el, key, value);
37
+ } else if (typeof value === "function") {
38
+ bindComputedProp(el, key, value);
39
+ } else {
40
+ bindStaticProp(el, key, value);
41
+ }
42
+ }
43
+ function bindRefProp(el, value) {
44
+ if (typeof value === "function") {
45
+ value(el);
46
+ } else if (isSignal(value)) {
47
+ value.set(el);
48
+ } else if (value && typeof value === "object" && "current" in value) {
49
+ value.current = el;
50
+ }
51
+ }
52
+ function isEventProp(key) {
53
+ return key.startsWith("on") && key.length > 2;
54
+ }
55
+ function bindEventProp(el, key, value) {
56
+ const eventName = key.substring(2).toLowerCase();
57
+ if (typeof value === "function") {
58
+ el.addEventListener(eventName, value);
59
+ }
60
+ }
61
+ function bindClassNameProp(el, value) {
62
+ if (isSignal(value)) {
63
+ effect(
64
+ () => {
65
+ const currentValue = getSignalValue(value);
66
+ applyClassName(el, currentValue);
67
+ }
68
+ );
69
+ } else if (typeof value === "function") {
70
+ effect(
71
+ () => {
72
+ const resolvedValue = value();
73
+ applyClassName(el, resolvedValue);
74
+ }
75
+ );
76
+ } else {
77
+ applyClassName(el, value);
78
+ }
79
+ }
80
+ function bindStyleProp(el, value) {
81
+ if (isSignal(value)) {
82
+ effect(
83
+ () => {
84
+ const currentValue = getSignalValue(value);
85
+ applyStyle(el, currentValue);
86
+ }
87
+ );
88
+ } else if (typeof value === "function") {
89
+ effect(
90
+ () => {
91
+ const resolvedValue = value();
92
+ applyStyle(el, resolvedValue);
93
+ }
94
+ );
95
+ } else {
96
+ applyStyle(el, value);
97
+ }
98
+ }
99
+ function bindSignalProp(el, key, signal) {
100
+ if (isCustomElement(el)) {
101
+ el[key] = signal;
102
+ } else {
103
+ effect(
104
+ () => {
105
+ const currentValue = getSignalValue(signal);
106
+ setElementProperty(el, key, currentValue);
107
+ }
108
+ );
109
+ }
110
+ }
111
+ function bindComputedProp(el, key, fn) {
112
+ effect(
113
+ () => {
114
+ const resolvedValue = fn();
115
+ if (isCustomElement(el)) {
116
+ el[key] = resolvedValue;
117
+ } else {
118
+ setElementProperty(el, key, resolvedValue);
119
+ }
120
+ }
121
+ );
122
+ }
123
+ function bindStaticProp(el, key, value) {
124
+ if (isCustomElement(el)) {
125
+ el[key] = value;
126
+ } else {
127
+ setElementProperty(el, key, value);
128
+ }
129
+ }
130
+ function getSignalValue(signal) {
131
+ try {
132
+ return typeof signal.get === "function" ? signal.get() : signal.valueOf?.() ?? signal;
133
+ } catch {
134
+ return String(signal);
135
+ }
136
+ }
137
+ function applyClassName(el, value) {
138
+ let classString = "";
139
+ if (typeof value === "string") {
140
+ classString = value;
141
+ } else if (Array.isArray(value)) {
142
+ classString = value.filter((cls) => cls != null && cls !== false && cls !== "").join(" ");
143
+ } else if (typeof value === "object" && value !== null) {
144
+ classString = Object.entries(value).filter(([className, condition]) => {
145
+ if (typeof condition === "function") {
146
+ return condition();
147
+ }
148
+ if (isSignal(condition)) {
149
+ return getSignalValue(condition);
150
+ }
151
+ return Boolean(condition);
152
+ }).map(([className]) => className).join(" ");
153
+ }
154
+ if (classString.trim()) {
155
+ el.setAttribute("class", classString.trim());
156
+ } else {
157
+ el.removeAttribute("class");
158
+ }
159
+ }
160
+ function applyStyle(el, value) {
161
+ const htmlEl = el;
162
+ if (typeof value === "string") {
163
+ htmlEl.style.cssText = value;
164
+ } else if (typeof value === "object" && value !== null) {
165
+ htmlEl.style.cssText = "";
166
+ Object.entries(value).forEach(([property, propValue]) => {
167
+ if (propValue == null || propValue === "") {
168
+ htmlEl.style.removeProperty(kebabCase(property));
169
+ } else {
170
+ const cssProperty = kebabCase(property);
171
+ const cssValue = typeof propValue === "number" ? addUnitIfNeeded(property, propValue) : String(propValue);
172
+ htmlEl.style.setProperty(cssProperty, cssValue);
173
+ }
174
+ });
175
+ } else if (value == null) {
176
+ htmlEl.style.cssText = "";
177
+ }
178
+ }
179
+ function kebabCase(str) {
180
+ return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
181
+ }
182
+ function addUnitIfNeeded(property, value) {
183
+ const pxProperties = /* @__PURE__ */ new Set([
184
+ "width",
185
+ "height",
186
+ "top",
187
+ "left",
188
+ "right",
189
+ "bottom",
190
+ "margin",
191
+ "marginTop",
192
+ "marginRight",
193
+ "marginBottom",
194
+ "marginLeft",
195
+ "padding",
196
+ "paddingTop",
197
+ "paddingRight",
198
+ "paddingBottom",
199
+ "paddingLeft",
200
+ "fontSize",
201
+ "lineHeight",
202
+ "borderWidth",
203
+ "borderRadius",
204
+ "maxWidth",
205
+ "maxHeight",
206
+ "minWidth",
207
+ "minHeight"
208
+ ]);
209
+ return pxProperties.has(property) ? `${value}px` : String(value);
210
+ }
211
+ const BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
212
+ "autofocus",
213
+ "checked",
214
+ "defaultchecked",
215
+ "defer",
216
+ "disabled",
217
+ "hidden",
218
+ "loop",
219
+ "multiple",
220
+ "muted",
221
+ "open",
222
+ "readonly",
223
+ "required",
224
+ "reversed",
225
+ "selected",
226
+ "autoplay",
227
+ "controls",
228
+ "draggable",
229
+ "contenteditable",
230
+ "spellcheck",
231
+ "translate"
232
+ ]);
233
+ const PROPERTY_NAMES = /* @__PURE__ */ new Set([
234
+ "value",
235
+ "checked",
236
+ "selected",
237
+ "disabled",
238
+ "readOnly",
239
+ "multiple",
240
+ "draggable",
241
+ "hidden",
242
+ "innerHTML",
243
+ "textContent",
244
+ "className"
245
+ ]);
246
+ function setElementProperty(el, key, value) {
247
+ const htmlEl = el;
248
+ if (key === "class") {
249
+ key = "className";
250
+ }
251
+ if (BOOLEAN_ATTRIBUTES.has(key.toLowerCase())) {
252
+ if (value === false || value == null || value === "") {
253
+ el.removeAttribute(key);
254
+ if (key in htmlEl) {
255
+ htmlEl[key] = false;
256
+ }
257
+ } else {
258
+ el.setAttribute(key, key);
259
+ if (key in htmlEl) {
260
+ htmlEl[key] = true;
261
+ }
262
+ }
263
+ return;
264
+ }
265
+ if (PROPERTY_NAMES.has(key) || key in htmlEl) {
266
+ try {
267
+ htmlEl[key] = value;
268
+ } catch (e) {
269
+ el.setAttribute(key, String(value));
270
+ }
271
+ return;
272
+ }
273
+ if (value == null || value === false) {
274
+ el.removeAttribute(key);
275
+ } else {
276
+ el.setAttribute(key, String(value));
277
+ }
278
+ }
279
+ export {
280
+ bindProps
281
+ };
@@ -0,0 +1,2 @@
1
+ import { ChildValue } from '../types.js';
2
+ export declare function renderTextChild(parent: Element, child: ChildValue): void;
@@ -0,0 +1,2 @@
1
+ import { jsx, Fragment } from './jsx-runtime';
2
+ export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
@@ -0,0 +1,3 @@
1
+ import { Fragment } from './types';
2
+ declare function jsx(..._args: any[]): any;
3
+ export { Fragment, jsx, jsx as jsxs };
@@ -0,0 +1,35 @@
1
+ import { Signal } from '../reactivity/signals/signal';
2
+ export type PropValue = string | number | boolean | Function | Signal<any> | PropObject | PropArray | ClassNameProp | StyleProp | null | undefined;
3
+ export type PropObject = {
4
+ [key: string]: string | number | boolean | null | undefined;
5
+ };
6
+ export type PropArray = (string | number | boolean | null | undefined)[];
7
+ export type ClassNameProp = string | string[] | {
8
+ [className: string]: boolean | Signal<boolean> | (() => boolean);
9
+ } | Signal<string | string[] | {
10
+ [className: string]: boolean;
11
+ }> | (() => string | string[] | {
12
+ [className: string]: boolean;
13
+ });
14
+ export type StyleProp = string | {
15
+ [property: string]: string | number | null | undefined;
16
+ } | Signal<string | {
17
+ [property: string]: string | number | null | undefined;
18
+ }> | (() => string | {
19
+ [property: string]: string | number | null | undefined;
20
+ });
21
+ export type EventHandler<T = Event> = (event: T) => void;
22
+ export type CustomEventHandler<T = any> = (data: T) => void;
23
+ export type ChildValue = string | number | Element | Function | Signal<any> | ChildValue[] | null | undefined | boolean;
24
+ export interface ComponentProps {
25
+ className?: ClassNameProp;
26
+ style?: StyleProp;
27
+ key?: string | number;
28
+ onClick?: EventHandler<MouseEvent>;
29
+ onInput?: EventHandler<InputEvent>;
30
+ onChange?: EventHandler<Event>;
31
+ onSubmit?: EventHandler<SubmitEvent>;
32
+ [eventName: `on${string}`]: CustomEventHandler<any> | EventHandler<any> | undefined;
33
+ [propName: string]: PropValue;
34
+ }
35
+ export declare const Fragment: unique symbol;
@@ -0,0 +1,4 @@
1
+ const Fragment = Symbol.for("v-ibe.fragment");
2
+ export {
3
+ Fragment
4
+ };
@@ -0,0 +1,2 @@
1
+ export * from './jsx/jsx-dev-runtime'
2
+ export {}
@@ -0,0 +1,8 @@
1
+ import { jsx, jsx as jsx2, jsx as jsx3 } from "./jsx-runtime.js";
2
+ import { Fragment } from "./jsx/types.js";
3
+ export {
4
+ Fragment,
5
+ jsx,
6
+ jsx2 as jsxDEV,
7
+ jsx3 as jsxs
8
+ };
@@ -0,0 +1,2 @@
1
+ export * from './jsx/jsx-runtime'
2
+ export {}
@@ -0,0 +1,11 @@
1
+ import { Fragment } from "./jsx/types.js";
2
+ function jsx(..._args) {
3
+ throw new Error(
4
+ "[v-ibe] jsx() should never be called directly. Ensure jsxContextualPlugin is enabled in your vite.config.ts"
5
+ );
6
+ }
7
+ export {
8
+ Fragment,
9
+ jsx,
10
+ jsx as jsxs
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * TEST: Bug de suscripciones en effects anidados dentro de untrack
3
+ *
4
+ * Este test reproduce el bug encontrado en RouteView con Shows anidados:
5
+ *
6
+ * ESCENARIO:
7
+ * - Effect padre (L0) crea children dentro de untrack()
8
+ * - Los children contienen múltiples effects (L1)
9
+ * - Cada effect L1 debería tener su propia suscripción a la señal
10
+ *
11
+ * BUG:
12
+ * - Con dos stacks separados (computationStack y contextStack),
13
+ * el contextStack tiene prioridad
14
+ * - Cuando untrack() pone tracking=false en contextStack, los effects hijos
15
+ * leen la computation del padre en lugar de la propia
16
+ * - Resultado: Solo 1 de N effects queda suscrito
17
+ *
18
+ * ESPERADO:
19
+ * - Cada effect debe tener su propia suscripción
20
+ * - Cuando la señal cambia, TODOS los effects deben re-ejecutarse
21
+ */
22
+ export {};
@@ -0,0 +1,57 @@
1
+ import { Subscriber } from './types';
2
+ /**
3
+ * ContextScope - RAII wrapper para gestionar contextos reactivos
4
+ *
5
+ * Garantiza que el contexto se restaure automáticamente cuando el scope
6
+ * sale de su bloque, incluso si hay errores.
7
+ *
8
+ * Usa el stack unificado de ReactiveContext internamente.
9
+ *
10
+ * USO CON ES2024 (using statement):
11
+ * ```typescript
12
+ * {
13
+ * using scope = new ContextScope(subscriber, true);
14
+ * // ... código que usa el contexto ...
15
+ * } // ← scope se limpia automáticamente aquí
16
+ * ```
17
+ *
18
+ * USO SIN ES2024 (helper function):
19
+ * ```typescript
20
+ * withContext(subscriber, true, () => {
21
+ * // ... código que usa el contexto ...
22
+ * });
23
+ * ```
24
+ */
25
+ export declare class ContextScope {
26
+ private exitFn;
27
+ constructor(computation: Subscriber | null, tracking: boolean);
28
+ /**
29
+ * Libera el contexto manualmente.
30
+ * Idempotente: puede llamarse múltiples veces sin efecto.
31
+ */
32
+ dispose(): void;
33
+ /**
34
+ * ES2024: Auto-cleanup cuando el objeto sale de scope.
35
+ * Se llama automáticamente cuando se usa con `using`.
36
+ */
37
+ [Symbol.dispose](): void;
38
+ }
39
+ /**
40
+ * Helper function para usar ContextScope sin ES2024.
41
+ *
42
+ * Garantiza que el contexto se restaure automáticamente incluso si hay errores.
43
+ *
44
+ * @param computation - La computación a establecer como contexto actual
45
+ * @param tracking - Si el tracking está activo
46
+ * @param fn - Función a ejecutar con el contexto establecido
47
+ * @returns El resultado de la función
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * withContext(structuralSubscriber, true, () => {
52
+ * void this.sourceArray.length;
53
+ * this.sourceArray._subscribe('mutation', structuralSubscriber);
54
+ * });
55
+ * ```
56
+ */
57
+ export declare function withContext<T>(computation: Subscriber | null, tracking: boolean, fn: () => T): T;
@@ -0,0 +1,35 @@
1
+ import { reactiveContext } from "./reactive-context.js";
2
+ class ContextScope {
3
+ constructor(computation, tracking) {
4
+ this.exitFn = reactiveContext.enter(computation, tracking, "legacy");
5
+ }
6
+ /**
7
+ * Libera el contexto manualmente.
8
+ * Idempotente: puede llamarse múltiples veces sin efecto.
9
+ */
10
+ dispose() {
11
+ if (this.exitFn) {
12
+ this.exitFn();
13
+ this.exitFn = null;
14
+ }
15
+ }
16
+ /**
17
+ * ES2024: Auto-cleanup cuando el objeto sale de scope.
18
+ * Se llama automáticamente cuando se usa con `using`.
19
+ */
20
+ [Symbol.dispose]() {
21
+ this.dispose();
22
+ }
23
+ }
24
+ function withContext(computation, tracking, fn) {
25
+ const scope = new ContextScope(computation, tracking);
26
+ try {
27
+ return fn();
28
+ } finally {
29
+ scope.dispose();
30
+ }
31
+ }
32
+ export {
33
+ ContextScope,
34
+ withContext
35
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Test de integración para @Ctx con el ciclo de vida completo
3
+ * Simula exactamente lo que pasa en el navegador
4
+ */
5
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Test para reproducir el bug de loop infinito con @Ctx
3
+ *
4
+ * El bug ocurre cuando:
5
+ * 1. Un RouteView usa @Ctx navigationLevel
6
+ * 2. Hay RouteViews anidados (padre e hijo)
7
+ * 3. El hijo busca $navigationLevel del padre y crea un derived
8
+ * 4. Algo en esta cadena causa un loop infinito
9
+ */
10
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @Computed es un decorador para getters que los convierte en señales computadas.
3
+ * El valor se calcula la primera vez que se accede y se memoriza.
4
+ * Se recalcula automáticamente solo cuando sus dependencias (@State) cambian.
5
+ */
6
+ export declare function Computed<This extends object, Value>(target: (this: This) => Value, context: ClassGetterDecoratorContext<This, Value>): (this: This) => Value;
@@ -0,0 +1,17 @@
1
+ import { computed } from "../signals/computed.js";
2
+ function Computed(target, context) {
3
+ if (context.kind !== "getter") {
4
+ throw new Error("@Computed solo se puede aplicar a getters de clase.");
5
+ }
6
+ const signalKey = Symbol(`computed_signal_${String(context.name)}`);
7
+ return function() {
8
+ if (!this[signalKey]) {
9
+ const getter = target.bind(this);
10
+ this[signalKey] = computed(getter);
11
+ }
12
+ return this[signalKey].get();
13
+ };
14
+ }
15
+ export {
16
+ Computed
17
+ };
@@ -0,0 +1,5 @@
1
+ import { Signal } from '../signals/signal';
2
+ export declare function createEventDecorator<TParams extends any[], TValue>(eventSignalFactory: (...params: TParams) => {
3
+ signal: Signal<TValue>;
4
+ cleanup: () => void;
5
+ }): (...params: TParams) => <This extends object>(target: undefined, context: ClassFieldDecoratorContext<This, TValue>) => (this: This, initialValue: TValue) => TValue;
@@ -0,0 +1,28 @@
1
+ function createEventDecorator(eventSignalFactory) {
2
+ return function(...params) {
3
+ return function(target, context) {
4
+ if (context.kind !== "field") {
5
+ throw new Error("Solo se puede aplicar a campos de clase.");
6
+ }
7
+ const signalKey = Symbol(`event_signal_${String(context.name)}`);
8
+ return function(initialValue) {
9
+ if (!this[signalKey]) {
10
+ const eventSignal = eventSignalFactory(...params);
11
+ this[signalKey] = eventSignal.signal;
12
+ this.registerCleanup(eventSignal.cleanup);
13
+ }
14
+ Object.defineProperty(this, context.name, {
15
+ get: () => this[signalKey].get(),
16
+ set: () => {
17
+ },
18
+ enumerable: true,
19
+ configurable: false
20
+ });
21
+ return this[signalKey].get();
22
+ };
23
+ };
24
+ };
25
+ }
26
+ export {
27
+ createEventDecorator
28
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @Ctx es un decorador que crea una propiedad reactiva contextual.
3
+ * La propiedad hereda su valor del primer componente padre que provea
4
+ * un contexto con el mismo nombre. Si no encuentra un padre, usa su
5
+ * valor inicial.
6
+ *
7
+ * @param mapper Una función opcional para transformar el valor recibido del padre.
8
+ */
9
+ export declare function Ctx<This extends object, Value>(mapper?: (value: Value | undefined, self: This) => Value): (target: undefined, context: ClassFieldDecoratorContext<This, Value>) => (this: This, initialValue: Value) => Value;
@@ -0,0 +1,91 @@
1
+ import { Signal } from "../signals/signal.js";
2
+ import { derived } from "../signals/derived.js";
3
+ import { AppTree } from "../../components/app-tree.js";
4
+ function Ctx(mapper) {
5
+ return function(target, context) {
6
+ if (context.kind !== "field") {
7
+ throw new Error("@Ctx solo se puede aplicar a campos de clase.");
8
+ }
9
+ const propName = context.name;
10
+ const signalPropName = `$${String(propName)}`;
11
+ return function(initialValue) {
12
+ const self = this;
13
+ let finalSignal = null;
14
+ let isContextInitialized = false;
15
+ const safeMapper = (v) => mapper ? mapper(v, self) : v;
16
+ const initializeContext = () => {
17
+ if (isContextInitialized) return;
18
+ const currentAppNode = self.appNode;
19
+ const parentNode = currentAppNode?.parent;
20
+ const sourceSignal = AppTree.findContextSignalFor(
21
+ signalPropName,
22
+ parentNode
23
+ );
24
+ if (sourceSignal) {
25
+ finalSignal = derived(sourceSignal, safeMapper);
26
+ } else {
27
+ const mappedInitialValue = safeMapper(initialValue);
28
+ finalSignal = new Signal(mappedInitialValue);
29
+ }
30
+ Object.defineProperty(self, signalPropName, {
31
+ get: () => finalSignal,
32
+ enumerable: false,
33
+ // No queremos que aparezca en un `for...in`
34
+ configurable: true
35
+ });
36
+ const propertyDescriptor = {
37
+ get: () => finalSignal.get(),
38
+ enumerable: true,
39
+ configurable: true,
40
+ set: (newValue) => {
41
+ const currentAppNode2 = self.appNode;
42
+ const parentNode2 = currentAppNode2?.parent;
43
+ const sourceSignal2 = AppTree.findContextSignalFor(
44
+ signalPropName,
45
+ parentNode2
46
+ );
47
+ if (!sourceSignal2) {
48
+ finalSignal.set(newValue);
49
+ }
50
+ }
51
+ };
52
+ Object.defineProperty(self, propName, propertyDescriptor);
53
+ isContextInitialized = true;
54
+ };
55
+ if (!self._pendingContextInitializers) {
56
+ self._pendingContextInitializers = [];
57
+ }
58
+ self._pendingContextInitializers.push(initializeContext);
59
+ Object.defineProperty(self, propName, {
60
+ get: () => {
61
+ if (!isContextInitialized) {
62
+ throw new Error(
63
+ `Context property '${String(propName)}' accessed before context initialization. Make sure the component is properly initialized via JSX.`
64
+ );
65
+ }
66
+ return finalSignal.get();
67
+ },
68
+ enumerable: true,
69
+ configurable: true,
70
+ set: (newValue) => {
71
+ if (!isContextInitialized) {
72
+ return;
73
+ }
74
+ const currentAppNode = self.appNode;
75
+ const parentNode = currentAppNode?.parent;
76
+ const sourceSignal = AppTree.findContextSignalFor(
77
+ signalPropName,
78
+ parentNode
79
+ );
80
+ if (!sourceSignal) {
81
+ finalSignal.set(newValue);
82
+ }
83
+ }
84
+ });
85
+ return safeMapper(initialValue);
86
+ };
87
+ };
88
+ }
89
+ export {
90
+ Ctx
91
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @Effect es un decorador para métodos que los convierte en una operación reactiva.
3
+ * El método se ejecutará una vez inicialmente y luego cada vez que una de las
4
+ * señales de las que depende cambie su valor.
5
+ *
6
+ * Para componentes (BaseComponent), los efectos se difieren hasta después de la
7
+ * inicialización completa para que las dependencias inyectadas estén disponibles.
8
+ */
9
+ export declare function Effect<This extends object>(target: (this: This, onCleanup: (cb: () => void) => void) => void, context: ClassMethodDecoratorContext<This, (this: This, onCleanup: (cb: () => void) => void) => void>): void;