arckode-ui 0.2.6 → 0.2.8

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/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@ Cambios entre versiones publicadas. Sigue [keepachangelog](https://keepachangelo
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.2.8] — 2026-05-23
8
+
9
+ ### Fixed
10
+ - **Template compiler — atributos con guiones**: atributos SVG (`stroke-width`, `stroke-linecap`),
11
+ `data-*` y `aria-*` se generaban sin comillas como clave JS, produciendo un syntax error en
12
+ esbuild (`Expected "}" but found "-"`). Fix: `jsKey()` en `attrToJs` detecta si el nombre
13
+ necesita comillas y las agrega — sólo afecta atributos que no son identificadores JS válidos.
14
+
15
+ ## [0.2.7] — 2026-05-23
16
+
17
+ ### Added
18
+ - **`createRouterView(routes)`**: nueva función que retorna un `Component` que renderiza
19
+ reactivamente la página que coincide con la URL actual. Cuando se llama `navigateTo()`,
20
+ el renderer desmonta la página anterior y monta la nueva automáticamente.
21
+ Exportada desde el barrel como `createRouterView` + tipo `RouteWithComponent`.
22
+ Uso: `mount(createRouterView(routes), '#app')` o como variable en template de layout.
23
+ - **`RouteWithComponent`**: tipo exportado `{ path: string; component: Component }` para
24
+ definir las rutas con sus componentes importados.
25
+
26
+ ### Fixed
27
+ - **Renderer `sameType`**: dos VNodes de componentes distintos (tags diferentes) se trataban
28
+ como tipos incompatibles, lo que causaba que `patch()` saltara el `__arkUnmount()` del
29
+ componente saliente al navegar. Ahora todos los VNodes con tag de componente se clasifican
30
+ como mismo tipo, delegando la lógica de swap+cleanup al branch de componentes en `patch()`.
31
+
7
32
  ## [0.2.6] — 2026-05-23
8
33
 
9
34
  ### Fixed
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import * as a from "node:fs";
3
3
  import * as n from "node:path";
4
4
  import { a as C } from "./analyzer-Ctnj3WTI.js";
5
- import { s as j } from "./router-By0pj28e.js";
5
+ import { s as j } from "./router-De-LmzWd.js";
6
6
  const E = `import { defineConfig } from 'vite'
7
7
  import { arkcodeUi } from 'arckode-ui/vite'
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"template-compiler.d.ts","sourceRoot":"","sources":["../../src/compiler/template-compiler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,QAAQ,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,CAAA;CAC7B;AAiZD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA2BpD"}
1
+ {"version":3,"file":"template-compiler.d.ts","sourceRoot":"","sources":["../../src/compiler/template-compiler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,QAAQ,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,CAAA;CAC7B;AAsZD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA2BpD"}
package/dist/index.d.ts CHANGED
@@ -11,4 +11,6 @@ export { createService, ArkServiceError } from './services/create-service';
11
11
  export type { RequestOptions, ServiceContext, ServiceOptions, ServiceDefinition, ServiceInstance, } from './services/create-service';
12
12
  export { createRouter, navigate, navigateTo, useRoute, getCurrentPath, } from './router/router';
13
13
  export type { RouteDefinition, RouteRef, Router, RouteInfo, } from './router/router';
14
+ export { createRouterView } from './router/router-view';
15
+ export type { RouteWithComponent } from './router/router-view';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACnE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEvE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1F,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAA;AAC/B,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC1E,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAA;AAIlC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,GACf,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,eAAe,EACf,QAAQ,EACR,MAAM,EACN,SAAS,GACV,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACnE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEvE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1F,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAA;AAC/B,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC1E,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAA;AAIlC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,GACf,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,eAAe,EACf,QAAQ,EACR,MAAM,EACN,SAAS,GACV,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA"}
package/dist/index.js CHANGED
@@ -1,58 +1,58 @@
1
- import { e as D, d as J, w as M } from "./router-By0pj28e.js";
2
- import { c as ue, a as ie, g as fe, n as le, b as de, u as ye } from "./router-By0pj28e.js";
1
+ import { e as J, d as M, w as R, _ as W } from "./router-De-LmzWd.js";
2
+ import { c as le, a as de, g as me, n as ye, b as he, u as pe } from "./router-De-LmzWd.js";
3
3
  const S = typeof process < "u" ? process.env.NODE_ENV !== "production" : !0;
4
- function y(e) {
4
+ function m(e) {
5
5
  S && console.warn(`[arckode-ui] ${e}`);
6
6
  }
7
- function R(e, n, t) {
7
+ function B(e, n, t) {
8
8
  for (const [r, s] of Object.entries(e)) {
9
9
  const o = n[r];
10
10
  if (s.required === !0 && o === void 0) {
11
- y(`[${t}] Prop requerido "${r}" no fue proporcionado.`);
11
+ m(`[${t}] Prop requerido "${r}" no fue proporcionado.`);
12
12
  continue;
13
13
  }
14
14
  if (o === void 0) continue;
15
15
  const c = s.type;
16
- c === String && typeof o == "string" || c === Number && typeof o == "number" || c === Boolean && typeof o == "boolean" || c === Array && Array.isArray(o) || c === Function && typeof o == "function" || c === Object && typeof o == "object" && !Array.isArray(o) && o !== null || y(
16
+ c === String && typeof o == "string" || c === Number && typeof o == "number" || c === Boolean && typeof o == "boolean" || c === Array && Array.isArray(o) || c === Function && typeof o == "function" || c === Object && typeof o == "object" && !Array.isArray(o) && o !== null || m(
17
17
  `[${t}] Prop "${r}" recibió tipo incorrecto. Esperado: ${c.name}, recibido: ${typeof o}.`
18
18
  );
19
19
  }
20
20
  }
21
- function W(e, n, t) {
22
- e.includes(n) || y(
21
+ function F(e, n, t) {
22
+ e.includes(n) || m(
23
23
  `[${t}] emit("${n}") no está declarado en emits[]. Declarar antes de usar.`
24
24
  );
25
25
  }
26
- function F(e, n) {
26
+ function I(e, n) {
27
27
  if (typeof e != "object" || e === null) {
28
- y(`[${n}] setup() debe retornar un objeto { state, computed, actions }.`);
28
+ m(`[${n}] setup() debe retornar un objeto { state, computed, actions }.`);
29
29
  return;
30
30
  }
31
31
  const t = /* @__PURE__ */ new Set(["state", "computed", "actions"]), r = Object.keys(e);
32
32
  for (const s of r)
33
- t.has(s) || y(
33
+ t.has(s) || m(
34
34
  `[${n}] setup() retornó una key no permitida: "${s}". Solo se permiten: state, computed, actions.`
35
35
  );
36
36
  }
37
- function Y(e) {
37
+ function K(e) {
38
38
  if (S) {
39
- if (e.name || y('defineComponent() requiere el campo "name".'), e.emits)
39
+ if (e.name || m('defineComponent() requiere el campo "name".'), e.emits)
40
40
  for (const t of e.emits)
41
- (t !== t.toLowerCase() || /[A-Z]/.test(t)) && y(
41
+ (t !== t.toLowerCase() || /[A-Z]/.test(t)) && m(
42
42
  `[${e.name}] El evento "${t}" en emits[] debe ser kebab-case. Usar "${t.replace(/([A-Z])/g, "-$1").toLowerCase()}" en su lugar.`
43
43
  );
44
44
  if (e.props)
45
45
  for (const [t, r] of Object.entries(e.props))
46
- r.type || y(`[${e.name}] El prop "${t}" no tiene "type" definido.`);
46
+ r.type || m(`[${e.name}] El prop "${t}" no tiene "type" definido.`);
47
47
  }
48
48
  const n = (t, r) => {
49
- S && R(e.props ?? {}, t, e.name);
49
+ S && B(e.props ?? {}, t, e.name);
50
50
  const s = {
51
51
  emit(c, u) {
52
- S && W(e.emits ?? [], c, e.name), r.emit(c, u);
52
+ S && F(e.emits ?? [], c, e.name), r.emit(c, u);
53
53
  }
54
54
  }, o = e.setup(t, s);
55
- return S && F(o, e.name), o;
55
+ return S && I(o, e.name), o;
56
56
  };
57
57
  return {
58
58
  name: e.name,
@@ -62,43 +62,43 @@ function Y(e) {
62
62
  setup: n
63
63
  };
64
64
  }
65
- let j = [], w = [], x = [];
66
- function I(e, n, t) {
67
- j = e, w = n, x = t;
65
+ let x = [], A = [], O = [];
66
+ function Z(e, n, t) {
67
+ x = e, A = n, O = t;
68
68
  }
69
- function V(e) {
70
- j.push(e);
69
+ function ne(e) {
70
+ x.push(e);
71
71
  }
72
- function ee(e) {
73
- w.push(e);
72
+ function re(e) {
73
+ A.push(e);
74
74
  }
75
- function te(e) {
76
- x.push(e);
75
+ function oe(e) {
76
+ O.push(e);
77
77
  }
78
- function ne(e, n, ...t) {
78
+ function w(e, n, ...t) {
79
79
  return {
80
80
  tag: e,
81
81
  props: n ?? {},
82
- children: A(t)
82
+ children: P(t)
83
83
  };
84
84
  }
85
- function A(e) {
85
+ function P(e) {
86
86
  const n = [];
87
87
  for (const t of e)
88
- t == null || t === !1 || t === !0 || (Array.isArray(t) ? n.push(...A(t)) : typeof t == "number" ? n.push(String(t)) : n.push(t));
88
+ t == null || t === !1 || t === !0 || (Array.isArray(t) ? n.push(...P(t)) : typeof t == "number" ? n.push(String(t)) : n.push(t));
89
89
  return n;
90
90
  }
91
- function O(e) {
91
+ function E(e) {
92
92
  return typeof e == "object" && e !== null && typeof e.setup == "function";
93
93
  }
94
- function B(e, n) {
94
+ function G(e, n) {
95
95
  const t = Object.keys(e), r = Object.keys(n);
96
96
  if (t.length !== r.length) return !1;
97
97
  for (const s of t)
98
98
  if (e[s] !== n[s]) return !1;
99
99
  return !0;
100
100
  }
101
- function P(e, n) {
101
+ function U(e, n) {
102
102
  for (const [t, r] of Object.entries(n))
103
103
  if (t !== "key") {
104
104
  if (t.startsWith("on") && t.length > 2 && typeof r == "function") {
@@ -130,38 +130,38 @@ function g(e) {
130
130
  return document.createTextNode("");
131
131
  if (typeof e == "string" || typeof e == "number")
132
132
  return document.createTextNode(String(e));
133
- if (O(e.tag)) {
133
+ if (E(e.tag)) {
134
134
  const t = document.createElement("div");
135
135
  t.style.display = "contents";
136
- const r = J(e.children), s = {
136
+ const r = M(e.children), s = {
137
137
  ...e.props,
138
138
  __slot_default: () => r.value
139
139
  };
140
140
  for (const [c, u] of Object.entries(e.props))
141
141
  if (c.startsWith("on") && c.length > 2 && typeof u == "function") {
142
142
  const i = c.slice(2).toLowerCase();
143
- t.addEventListener(i, (m) => {
144
- const h = m.detail;
143
+ t.addEventListener(i, (y) => {
144
+ const h = y.detail;
145
145
  u(h);
146
146
  });
147
147
  }
148
- const o = H(e.tag, s, t, null);
148
+ const o = N(e.tag, s, t, null);
149
149
  return t.__arkUnmount = o, t.__arkSlot = r, t.__arkTag = e.tag, t.__arkStaticProps = { ...e.props }, t;
150
150
  }
151
151
  const n = document.createElement(e.tag);
152
- P(n, e.props);
152
+ U(n, e.props);
153
153
  for (const t of e.children)
154
154
  n.appendChild(g(t));
155
155
  return n;
156
156
  }
157
- function K(e, n) {
158
- return e == null ? n == null : n == null ? !1 : typeof e == "string" ? typeof n == "string" : typeof n == "string" ? !1 : e.tag === n.tag;
157
+ function X(e, n) {
158
+ return e == null ? n == null : n == null ? !1 : typeof e == "string" ? typeof n == "string" : typeof n == "string" ? !1 : E(e.tag) && E(n.tag) ? !0 : e.tag === n.tag;
159
159
  }
160
- function U(e, n, t) {
161
- var m, h, l, C, f, p;
162
- if (!K(n, t)) {
160
+ function H(e, n, t) {
161
+ var y, h, l, _, f, p;
162
+ if (!X(n, t)) {
163
163
  const a = g(t);
164
- return (m = e.parentNode) == null || m.replaceChild(a, e), a;
164
+ return (y = e.parentNode) == null || y.replaceChild(a, e), a;
165
165
  }
166
166
  if (typeof t == "string" || t === null || t === void 0) {
167
167
  const a = t == null ? "" : String(t);
@@ -170,87 +170,87 @@ function U(e, n, t) {
170
170
  const d = document.createTextNode(a);
171
171
  return (h = e.parentNode) == null || h.replaceChild(d, e), d;
172
172
  }
173
- if (O(t.tag)) {
174
- const a = e, d = t, k = a.__arkTag, E = d.tag;
175
- if (k === E && a.__arkSlot) {
173
+ if (E(t.tag)) {
174
+ const a = e, d = t, k = a.__arkTag, C = d.tag;
175
+ if (k === C && a.__arkSlot) {
176
176
  a.__arkSlot.value = d.children;
177
- const L = a.__arkStaticProps ?? {}, q = d.props;
178
- if (!B(L, q)) {
177
+ const q = a.__arkStaticProps ?? {}, D = d.props;
178
+ if (!G(q, D)) {
179
179
  (l = a.__arkUnmount) == null || l.call(a);
180
180
  const T = g(t);
181
- return (C = e.parentNode) == null || C.replaceChild(T, e), T;
181
+ return (_ = e.parentNode) == null || _.replaceChild(T, e), T;
182
182
  }
183
183
  return e;
184
184
  }
185
185
  (f = a.__arkUnmount) == null || f.call(a);
186
- const $ = g(t);
187
- return (p = e.parentNode) == null || p.replaceChild($, e), $;
186
+ const v = g(t);
187
+ return (p = e.parentNode) == null || p.replaceChild(v, e), v;
188
188
  }
189
189
  const r = e, s = (n == null ? void 0 : n.props) ?? {}, o = t.props;
190
190
  for (const [a, d] of Object.entries(s))
191
191
  a.startsWith("on") && a.length > 2 && typeof d == "function" && r.removeEventListener(a.slice(2).toLowerCase(), d);
192
192
  for (const a of Object.keys(s))
193
193
  !(a in o) && !a.startsWith("on") && r.removeAttribute(a);
194
- P(r, o);
194
+ U(r, o);
195
195
  const c = n.children, u = t.children, i = Math.max(c.length, u.length);
196
196
  for (let a = 0; a < i; a++) {
197
- const d = c[a], k = u[a], E = r.childNodes[a];
197
+ const d = c[a], k = u[a], C = r.childNodes[a];
198
198
  if (k === void 0) {
199
199
  for (; r.childNodes.length > a; )
200
200
  r.removeChild(r.childNodes[a]);
201
201
  break;
202
202
  }
203
- E === void 0 ? r.appendChild(g(k)) : U(E, d ?? null, k);
203
+ C === void 0 ? r.appendChild(g(k)) : H(C, d ?? null, k);
204
204
  }
205
205
  return r;
206
206
  }
207
- function re(e, n) {
207
+ function ce(e, n) {
208
208
  const t = document.querySelector(n);
209
209
  if (!t) throw new Error(`[arckode-ui] mount: "${n}" not found`);
210
- return H(e, {}, t, null);
210
+ return N(e, {}, t, null);
211
211
  }
212
- function H(e, n, t, r) {
212
+ function N(e, n, t, r) {
213
213
  const s = [], o = [];
214
- I(s, o, []);
214
+ Z(s, o, []);
215
215
  const u = r ?? ((f, p) => {
216
216
  t.dispatchEvent(
217
217
  new CustomEvent(f, { detail: p, bubbles: !0 })
218
218
  );
219
- }), i = e.setup(n, { emit: u }), m = e.__render;
220
- if (!m)
219
+ }), i = e.setup(n, { emit: u }), y = e.__render;
220
+ if (!y)
221
221
  return (typeof process > "u" || process.env.NODE_ENV !== "production") && console.warn(
222
222
  `[arckode-ui] ${e.name}: no __render. ¿Compilado por el Vite plugin?`
223
223
  ), () => {
224
224
  };
225
225
  let h = null, l = null;
226
- const C = D(() => {
227
- const f = m(
226
+ const _ = J(() => {
227
+ const f = y(
228
228
  n,
229
229
  i.state ?? {},
230
230
  i.computed ?? {},
231
231
  i.actions ?? {}
232
232
  );
233
- l === null ? (l = g(f), t.appendChild(l)) : l = U(l, h, f), h = f;
233
+ l === null ? (l = g(f), t.appendChild(l)) : l = H(l, h, f), h = f;
234
234
  });
235
235
  return queueMicrotask(() => {
236
236
  for (const f of s) f();
237
237
  }), () => {
238
238
  var f;
239
- C();
239
+ _();
240
240
  for (const p of o) p();
241
241
  l && ((f = l.parentNode) == null || f.removeChild(l));
242
242
  };
243
243
  }
244
- const _ = /* @__PURE__ */ new Map();
245
- function N(e) {
244
+ const $ = /* @__PURE__ */ new Map();
245
+ function L(e) {
246
246
  try {
247
247
  return e === "localStorage" ? typeof localStorage < "u" ? localStorage : null : typeof sessionStorage < "u" ? sessionStorage : null;
248
248
  } catch {
249
249
  return null;
250
250
  }
251
251
  }
252
- function Z(e, n) {
253
- const t = N(e.storage);
252
+ function z(e, n) {
253
+ const t = L(e.storage);
254
254
  if (t)
255
255
  try {
256
256
  const r = t.getItem(e.key);
@@ -261,8 +261,8 @@ function Z(e, n) {
261
261
  } catch {
262
262
  }
263
263
  }
264
- function G(e, n) {
265
- const t = N(e.storage);
264
+ function Q(e, n) {
265
+ const t = L(e.storage);
266
266
  if (t)
267
267
  try {
268
268
  const r = e.pick ?? Object.keys(n), s = {};
@@ -272,30 +272,30 @@ function G(e, n) {
272
272
  } catch {
273
273
  }
274
274
  }
275
- function X(e, n) {
276
- Z(e, n);
275
+ function Y(e, n) {
276
+ z(e, n);
277
277
  const t = e.pick ?? Object.keys(n);
278
278
  for (const r of t)
279
- r in n && M(n[r], () => {
280
- G(e, n);
279
+ r in n && R(n[r], () => {
280
+ Q(e, n);
281
281
  });
282
282
  }
283
- function oe(e, n) {
283
+ function se(e, n) {
284
284
  return (!e || e.trim() === "") && console.warn("[arckode-ui] defineStore: el id del store no puede estar vacío"), (!n.state || typeof n.state != "object" || Array.isArray(n.state)) && console.warn("[arckode-ui] defineStore: state debe ser un objeto de signals"), function() {
285
- if (_.has(e))
286
- return _.get(e);
285
+ if ($.has(e))
286
+ return $.get(e);
287
287
  const r = {
288
288
  state: n.state,
289
289
  actions: n.actions,
290
290
  getters: n.getters ?? {}
291
291
  };
292
- return n.persist && X(
292
+ return n.persist && Y(
293
293
  n.persist,
294
294
  n.state
295
- ), _.set(e, r), r;
295
+ ), $.set(e, r), r;
296
296
  };
297
297
  }
298
- class v extends Error {
298
+ class j extends Error {
299
299
  constructor(n, t, r) {
300
300
  super(r), this.status = n, this.body = t, this.name = "ArkServiceError";
301
301
  }
@@ -320,17 +320,17 @@ async function b(e, n, t) {
320
320
  }
321
321
  }
322
322
  if (!o.ok)
323
- throw new v(
323
+ throw new j(
324
324
  o.status,
325
325
  c,
326
326
  `HTTP ${o.status}`
327
327
  );
328
328
  return c;
329
329
  } catch (o) {
330
- throw clearTimeout(s), o instanceof v, o;
330
+ throw clearTimeout(s), o instanceof j, o;
331
331
  }
332
332
  }
333
- function z(e) {
333
+ function V(e) {
334
334
  const n = e.timeout ?? 5e3, t = e.headers ?? {};
335
335
  function r(s) {
336
336
  return { ...t, ...s };
@@ -405,30 +405,57 @@ function z(e) {
405
405
  }
406
406
  };
407
407
  }
408
- function ce(e, n) {
409
- const t = z(e), r = {};
408
+ function ae(e, n) {
409
+ const t = V(e), r = {};
410
410
  for (const s of Object.keys(n))
411
411
  r[s] = n[s].bind(t);
412
412
  return r;
413
413
  }
414
+ function ee(e, n) {
415
+ if (e === n) return !0;
416
+ if (e === "/") return n === "/";
417
+ const t = e.split("/").filter(Boolean), r = n.split("/").filter(Boolean);
418
+ if (t.length !== r.length) return !1;
419
+ for (let s = 0; s < t.length; s++) {
420
+ const o = t[s];
421
+ if (o === "*") return !0;
422
+ if (!o.startsWith(":") && o !== r[s])
423
+ return !1;
424
+ }
425
+ return !0;
426
+ }
427
+ function ue(e) {
428
+ const n = K({
429
+ name: "RouterView",
430
+ setup: () => ({ state: {}, computed: {}, actions: {} })
431
+ }), t = (r, s, o, c) => {
432
+ const u = W.value;
433
+ for (const i of e)
434
+ if (ee(i.path, u))
435
+ return w(i.component, {});
436
+ return w("div", {});
437
+ };
438
+ return n.__render = t, n;
439
+ }
414
440
  export {
415
- v as ArkServiceError,
416
- ue as computed,
417
- ie as createRouter,
418
- ce as createService,
419
- Y as defineComponent,
420
- oe as defineStore,
421
- D as effect,
422
- fe as getCurrentPath,
423
- ne as h,
424
- re as mount,
425
- H as mountComponent,
426
- le as navigate,
427
- de as navigateTo,
428
- V as onMount,
429
- ee as onUnmount,
430
- te as onUpdate,
431
- J as signal,
432
- ye as useRoute,
433
- M as watch
441
+ j as ArkServiceError,
442
+ le as computed,
443
+ de as createRouter,
444
+ ue as createRouterView,
445
+ ae as createService,
446
+ K as defineComponent,
447
+ se as defineStore,
448
+ J as effect,
449
+ me as getCurrentPath,
450
+ w as h,
451
+ ce as mount,
452
+ N as mountComponent,
453
+ ye as navigate,
454
+ he as navigateTo,
455
+ ne as onMount,
456
+ re as onUnmount,
457
+ oe as onUpdate,
458
+ M as signal,
459
+ pe as useRoute,
460
+ R as watch
434
461
  };
@@ -0,0 +1,25 @@
1
+ import { Component } from '../runtime/define-component';
2
+ export interface RouteWithComponent {
3
+ /** URL pattern — same format as RouteDefinition.path (e.g. '/users/:id') */
4
+ path: string;
5
+ /** The imported .ark component to render for this route */
6
+ component: Component;
7
+ }
8
+ /**
9
+ * Creates a RouterView component that reactively renders the page
10
+ * matched by the current URL path.
11
+ *
12
+ * Usage A — mount directly as app root:
13
+ * mount(createRouterView(routes), '#app')
14
+ *
15
+ * Usage B — as a variable in an .ark layout template:
16
+ * // in <script> (module level):
17
+ * const RouterView = createRouterView(routes)
18
+ * // in <template>:
19
+ * <RouterView />
20
+ *
21
+ * When navigateTo() is called, the matched component is swapped
22
+ * automatically — the renderer unmounts the old page and mounts the new one.
23
+ */
24
+ export declare function createRouterView(routes: RouteWithComponent[]): Component;
25
+ //# sourceMappingURL=router-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-view.d.ts","sourceRoot":"","sources":["../../src/router/router-view.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAK5D,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,2DAA2D;IAC3D,SAAS,EAAE,SAAS,CAAA;CACrB;AAsBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAqBxE"}
@@ -20,6 +20,8 @@ export interface Router {
20
20
  } | null;
21
21
  navigate(path: string): void;
22
22
  }
23
+ export declare const _pathSignal: import('..').Signal<string>;
24
+ export declare const _paramsSignal: import('..').Signal<Record<string, string>>;
23
25
  export declare function getCurrentPath(): string;
24
26
  /** Reset module state between tests. Not part of the public API. */
25
27
  export declare function _resetRouterState(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAA;AAEtC,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAA;IACtF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAoBD,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAqHD;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,CA0D7D;AAgED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CA4C9D;AAMD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMhD;AAMD;;GAEG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,IAAI,CAeN;AAMD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAMpC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAA;AAEtC,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAA;IACtF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAMD,eAAO,MAAM,WAAW,6BAAmF,CAAA;AAC3G,eAAO,MAAM,aAAa,6CAAqC,CAAA;AAa/D,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAqHD;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,CA0D7D;AAgED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CA4C9D;AAMD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMhD;AAMD;;GAEG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,IAAI,CAeN;AAMD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAMpC"}
@@ -217,6 +217,7 @@ function R() {
217
217
  };
218
218
  }
219
219
  export {
220
+ c as _,
220
221
  N as a,
221
222
  O as b,
222
223
  A as c,
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/runtime/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AA6PnD,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,IAAI,CAIxE;AAED,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,GAC9D,MAAM,IAAI,CA4DZ"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/runtime/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAgQnD,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,IAAI,CAIxE;AAED,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,GAC9D,MAAM,IAAI,CA4DZ"}
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
- var y = Object.defineProperty;
2
- var C = (r, t, e) => t in r ? y(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var x = (r, t, e) => C(r, typeof t != "symbol" ? t + "" : t, e);
1
+ var C = Object.defineProperty;
2
+ var O = (r, t, e) => t in r ? C(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var x = (r, t, e) => O(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { transformWithEsbuild as b } from "vite";
5
5
  import { a as N, f as v } from "./analyzer-Ctnj3WTI.js";
6
6
  class h extends Error {
@@ -12,25 +12,25 @@ class h extends Error {
12
12
  }
13
13
  }
14
14
  const k = /<(template|script|style)((?:\s+[^>]*)??)>([\s\S]*?)<\/\1>/g;
15
- function O(r, t) {
15
+ function T(r, t) {
16
16
  let e = 1;
17
17
  for (let n = 0; n < t; n++)
18
18
  r[n] === `
19
19
  ` && e++;
20
20
  return e;
21
21
  }
22
- function T(r, t) {
22
+ function R(r, t) {
23
23
  const n = new RegExp(`${t}=["']([^"']*)["']`).exec(r);
24
24
  return n != null ? n[1] ?? null : null;
25
25
  }
26
- function R(r, t) {
26
+ function L(r, t) {
27
27
  return new RegExp(`(?:^|\\s)${t}(?:\\s|$|=)`).test(r);
28
28
  }
29
- function L(r) {
29
+ function j(r) {
30
30
  const t = [];
31
31
  let e;
32
32
  for (k.lastIndex = 0; (e = k.exec(r)) !== null; ) {
33
- const i = e[1], u = e[2] ?? "", d = e[3] ?? "", m = O(r, e.index);
33
+ const i = e[1], u = e[2] ?? "", d = e[3] ?? "", m = T(r, e.index);
34
34
  i !== void 0 && t.push({ tag: i, attrs: u, content: d, openLine: m });
35
35
  }
36
36
  const n = t.filter((i) => i.tag === "template"), s = t.filter((i) => i.tag === "script"), c = t.filter((i) => i.tag === "style");
@@ -61,7 +61,7 @@ function L(r) {
61
61
  "<script> must appear after <template>",
62
62
  o.openLine
63
63
  );
64
- const l = T(o.attrs, "lang");
64
+ const l = R(o.attrs, "lang");
65
65
  if (l !== "ts")
66
66
  throw new h(
67
67
  "MISSING_LANG_TS",
@@ -70,7 +70,7 @@ function L(r) {
70
70
  );
71
71
  let f;
72
72
  if (c.length > 0) {
73
- const i = c[0], u = R(i.attrs, "scoped");
73
+ const i = c[0], u = L(i.attrs, "scoped");
74
74
  f = { content: i.content, scoped: u };
75
75
  }
76
76
  return {
@@ -85,12 +85,12 @@ function L(r) {
85
85
  ...f !== void 0 ? { style: f } : {}
86
86
  };
87
87
  }
88
- const E = /(?:(@[\w.]+|:[a-zA-Z][\w-]*|v-else-if|v-if|v-for|v-show|v-else|[\w-]+)(?:="([^"]*)")?)/g;
89
- function j(r) {
88
+ const A = /(?:(@[\w.]+|:[a-zA-Z][\w-]*|v-else-if|v-if|v-for|v-show|v-else|[\w-]+)(?:="([^"]*)")?)/g;
89
+ function z(r) {
90
90
  const t = [];
91
- E.lastIndex = 0;
91
+ A.lastIndex = 0;
92
92
  let e;
93
- for (; (e = E.exec(r)) !== null; )
93
+ for (; (e = A.exec(r)) !== null; )
94
94
  t.push({ name: e[1] ?? "", value: e[2] ?? "", raw: e[0] });
95
95
  return t;
96
96
  }
@@ -131,7 +131,7 @@ function W(r) {
131
131
  } else {
132
132
  const d = {
133
133
  tag: p,
134
- attrs: j(f),
134
+ attrs: z(f),
135
135
  children: [],
136
136
  selfClosing: i
137
137
  };
@@ -145,7 +145,7 @@ function W(r) {
145
145
  return t;
146
146
  }
147
147
  const $ = /\{\{\s*([\s\S]+?)\s*\}\}/g;
148
- function z(r) {
148
+ function J(r) {
149
149
  return $.lastIndex = 0, $.test(r);
150
150
  }
151
151
  function M(r) {
@@ -169,36 +169,45 @@ const D = {
169
169
  delete: "Delete",
170
170
  backspace: "Backspace"
171
171
  };
172
- function J(r, t) {
172
+ function P(r, t) {
173
173
  const e = r.slice(1), [n, ...s] = e.split("."), p = `on${n.charAt(0).toUpperCase() + n.slice(1)}`;
174
174
  if (s.length === 0)
175
175
  return `${p}: ${t}`;
176
176
  const o = s[0].toLowerCase(), l = D[o] ?? o.charAt(0).toUpperCase() + o.slice(1);
177
177
  return `${p}: (e) => e.key === '${l}' && ${t}(e)`;
178
178
  }
179
- function P(r) {
180
- const { name: t, value: e } = r;
181
- return t.startsWith("@") ? J(t, e) : t.startsWith(":") ? `${t.slice(1)}: ${e}` : ["v-if", "v-for", "v-else", "v-else-if"].includes(t) ? null : t === "v-show" ? `style: { display: ${e} ? '' : 'none' }` : e === "" ? `${t}: true` : `${t}: ${JSON.stringify(e)}`;
179
+ function S(r) {
180
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r) ? r : JSON.stringify(r);
182
181
  }
183
182
  function V(r) {
183
+ const { name: t, value: e } = r;
184
+ if (t.startsWith("@"))
185
+ return P(t, e);
186
+ if (t.startsWith(":")) {
187
+ const n = t.slice(1);
188
+ return `${S(n)}: ${e}`;
189
+ }
190
+ return ["v-if", "v-for", "v-else", "v-else-if"].includes(t) ? null : t === "v-show" ? `style: { display: ${e} ? '' : 'none' }` : e === "" ? `${S(t)}: true` : `${S(t)}: ${JSON.stringify(e)}`;
191
+ }
192
+ function G(r) {
184
193
  const t = r;
185
- return z(t) ? `h('span', null, ${M(t)})` : /^\s+$/.test(t) ? "" : JSON.stringify(t);
194
+ return J(t) ? `h('span', null, ${M(t)})` : /^\s+$/.test(t) ? "" : JSON.stringify(t);
186
195
  }
187
196
  function w(r) {
188
197
  const t = r.attrs.find((f) => f.name === "v-for");
189
198
  if (r.tag === "slot")
190
199
  return "(props.__slot_default ? props.__slot_default() : [])";
191
- const e = r.attrs.map(P).filter((f) => f !== null && f !== ""), n = e.length === 0 ? "null" : `{ ${e.join(", ")} }`, s = A(r.children);
200
+ const e = r.attrs.map(V).filter((f) => f !== null && f !== ""), n = e.length === 0 ? "null" : `{ ${e.join(", ")} }`, s = y(r.children);
192
201
  let l = `h(${[/^[A-Z]/.test(r.tag) ? r.tag : JSON.stringify(r.tag), n, ...s].join(", ")})`;
193
- return t !== void 0 && (l = G(t.value, l)), l;
202
+ return t !== void 0 && (l = Z(t.value, l)), l;
194
203
  }
195
- function A(r) {
204
+ function y(r) {
196
205
  const t = [];
197
206
  let e = 0;
198
207
  for (; e < r.length; ) {
199
208
  const n = r[e];
200
209
  if (n.kind === "text") {
201
- const o = V(n.text);
210
+ const o = G(n.text);
202
211
  o !== "" && t.push(o), e++;
203
212
  continue;
204
213
  }
@@ -232,7 +241,7 @@ function A(r) {
232
241
  }
233
242
  return t;
234
243
  }
235
- function G(r, t) {
244
+ function Z(r, t) {
236
245
  const e = /^\s*(?:\(([^)]+)\)|(\w+))\s+in\s+(.+?)\s*$/.exec(r);
237
246
  if (!e)
238
247
  return `(${r}).map((item) => ${t})`;
@@ -240,7 +249,7 @@ function G(r, t) {
240
249
  return `${e[3].trim()}.map((${n}) => ${t})`;
241
250
  }
242
251
  function F(r) {
243
- const t = W(r.trim()), e = A(t).filter((s) => s !== "");
252
+ const t = W(r.trim()), e = y(t).filter((s) => s !== "");
244
253
  let n;
245
254
  return e.length === 0 ? n = "null" : e.length === 1 ? n = e[0] : n = `[${e.join(", ")}]`, `function h(tag, props, ...children) {
246
255
  return { tag, props: props ?? {}, children: children.flat().filter(c => c != null) }
@@ -257,7 +266,7 @@ function U(r) {
257
266
  t = (t << 5) + t ^ r.charCodeAt(n), t = t | 0;
258
267
  return (t >>> 0).toString(36).padStart(6, "0").slice(-6);
259
268
  }
260
- function Z(r) {
269
+ function K(r) {
261
270
  const t = /export\s+default\s+(defineComponent\s*\([\s\S]*\))\s*;?\s*$/, e = r.trim(), n = t.exec(e);
262
271
  return n ? {
263
272
  preamble: e.slice(0, n.index).trim(),
@@ -267,8 +276,8 @@ function Z(r) {
267
276
  defineComponentExpr: null
268
277
  };
269
278
  }
270
- function K(r, t, e) {
271
- const s = F(t).replace(/export default function render/, "function render").replace(/function h\(tag, props, \.\.\.children\) \{\n return [^\n]+\n\}\n+/, "").trim(), { preamble: c, defineComponentExpr: p } = Z(r);
279
+ function B(r, t, e) {
280
+ const s = F(t).replace(/export default function render/, "function render").replace(/function h\(tag, props, \.\.\.children\) \{\n return [^\n]+\n\}\n+/, "").trim(), { preamble: c, defineComponentExpr: p } = K(r);
272
281
  return p ? [
273
282
  "import { defineComponent, h } from 'arckode-ui'",
274
283
  "",
@@ -298,7 +307,7 @@ function K(r, t, e) {
298
307
  ].join(`
299
308
  `);
300
309
  }
301
- function H(r = {}) {
310
+ function Q(r = {}) {
302
311
  let t = "development";
303
312
  return {
304
313
  name: "arckode-ui",
@@ -307,11 +316,11 @@ function H(r = {}) {
307
316
  t = e.mode;
308
317
  },
309
318
  transform(e, n) {
310
- var S, _;
319
+ var _, E;
311
320
  if (!n.endsWith(".ark")) return null;
312
321
  let s;
313
322
  try {
314
- s = L(e);
323
+ s = j(e);
315
324
  } catch (a) {
316
325
  if (a instanceof h) {
317
326
  const g = [
@@ -325,7 +334,7 @@ function H(r = {}) {
325
334
  }
326
335
  throw a;
327
336
  }
328
- const c = ((S = r.analyzer) == null ? void 0 : S.ignore) ?? [], p = ((_ = r.analyzer) == null ? void 0 : _.failOnWarnings) ?? !1, l = N(e).filter((a) => !c.includes(a.code)), f = l.filter((a) => a.severity === "error"), i = l.filter((a) => a.severity === "warning"), u = t === "production";
337
+ const c = ((_ = r.analyzer) == null ? void 0 : _.ignore) ?? [], p = ((E = r.analyzer) == null ? void 0 : E.failOnWarnings) ?? !1, l = N(e).filter((a) => !c.includes(a.code)), f = l.filter((a) => a.severity === "error"), i = l.filter((a) => a.severity === "warning"), u = t === "production";
329
338
  for (const a of i)
330
339
  console.warn(v(a, n, e));
331
340
  if (f.length > 0) {
@@ -352,7 +361,7 @@ ${a}`);
352
361
  ${a}`
353
362
  );
354
363
  }
355
- const d = U(n), m = K(s.script.content, s.template.content, d);
364
+ const d = U(n), m = B(s.script.content, s.template.content, d);
356
365
  return b(m, n + ".ts", {
357
366
  loader: "ts",
358
367
  target: "esnext"
@@ -361,6 +370,6 @@ ${a}`
361
370
  };
362
371
  }
363
372
  export {
364
- H as arkcodeUi,
373
+ Q as arkcodeUi,
365
374
  U as generateScopeId
366
375
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arckode-ui",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "type": "module",
5
5
  "description": "Frontend framework con .ark SFCs, signals, file-system router y analyzer estático con sugerencias concretas de fix. Diseñado para máxima predictibilidad de output de IA.",
6
6
  "keywords": [