@tachui/data 0.8.8 → 0.8.10-alpha.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.
- package/dist/List.js +1648 -426
- package/package.json +5 -5
package/dist/List.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { withModifiers as
|
|
1
|
+
var Re = Object.defineProperty;
|
|
2
|
+
var Oe = (n, e, t) => e in n ? Re(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var m = (n, e, t) => Oe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { withModifiers as ue, ComponentWithCSSClasses as Pe, processElementOverride as ke, h as w, text as Le, clonePropsPreservingReactivity as fe, resetLifecycleState as me, createSignal as N, isSignal as S, createEffect as R } from "@tachui/core";
|
|
5
5
|
import "@tachui/modifiers";
|
|
6
|
-
const
|
|
6
|
+
const y = {
|
|
7
7
|
Clean: 0,
|
|
8
8
|
Check: 1,
|
|
9
9
|
Dirty: 2,
|
|
10
10
|
Disposed: 3
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
12
|
+
var De = Object.defineProperty, ze = (n, e, t) => e in n ? De(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, O = (n, e, t) => ze(n, typeof e != "symbol" ? e + "" : e, t);
|
|
13
|
+
let _e = 0;
|
|
14
|
+
const He = Math.random().toString(36).substr(2, 6);
|
|
15
|
+
let ge = null, ye = null;
|
|
16
|
+
const Ve = /* @__PURE__ */ new Set();
|
|
17
|
+
Ve.add(He);
|
|
18
|
+
const Q = {
|
|
19
19
|
get currentComputation() {
|
|
20
|
-
return
|
|
20
|
+
return ge;
|
|
21
21
|
},
|
|
22
22
|
set currentComputation(n) {
|
|
23
|
-
|
|
23
|
+
ge = n;
|
|
24
24
|
},
|
|
25
25
|
get currentOwner() {
|
|
26
|
-
return
|
|
26
|
+
return ye;
|
|
27
27
|
},
|
|
28
28
|
set currentOwner(n) {
|
|
29
|
-
|
|
29
|
+
ye = n;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function we() {
|
|
33
|
+
return Q.currentComputation;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
35
|
+
function Ce() {
|
|
36
|
+
return Q.currentOwner;
|
|
37
37
|
}
|
|
38
|
-
let
|
|
38
|
+
let Ee = class {
|
|
39
39
|
constructor(e, t = null) {
|
|
40
|
-
|
|
40
|
+
O(this, "id"), O(this, "owner"), O(this, "fn"), O(this, "sources", /* @__PURE__ */ new Set()), O(this, "observers", /* @__PURE__ */ new Set()), O(this, "state", y.Dirty), O(this, "value"), this.id = ++_e, this.fn = e, this.owner = t, t && !t.disposed && t.sources.add(this);
|
|
41
41
|
}
|
|
42
42
|
execute() {
|
|
43
|
-
if (this.state ===
|
|
43
|
+
if (this.state === y.Disposed)
|
|
44
44
|
return this.value;
|
|
45
45
|
for (const t of this.sources)
|
|
46
46
|
t && typeof t == "object" && "removeObserver" in t && t.removeObserver(this);
|
|
47
47
|
this.sources.clear();
|
|
48
|
-
const e =
|
|
49
|
-
|
|
48
|
+
const e = Q.currentComputation;
|
|
49
|
+
Q.currentComputation = this;
|
|
50
50
|
try {
|
|
51
|
-
return this.state =
|
|
51
|
+
return this.state = y.Clean, this.value = this.fn(), this.value;
|
|
52
52
|
} catch (t) {
|
|
53
|
-
throw this.state =
|
|
53
|
+
throw this.state = y.Disposed, (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error in computation:", t), t;
|
|
54
54
|
} finally {
|
|
55
|
-
|
|
55
|
+
Q.currentComputation = e;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
dispose() {
|
|
59
|
-
if (this.state !==
|
|
60
|
-
this.state =
|
|
59
|
+
if (this.state !== y.Disposed) {
|
|
60
|
+
this.state = y.Disposed;
|
|
61
61
|
for (const e of this.sources)
|
|
62
62
|
e && typeof e == "object" && "removeObserver" in e && e.removeObserver(this);
|
|
63
63
|
this.sources.clear();
|
|
@@ -67,17 +67,17 @@ let oe = class {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
var
|
|
71
|
-
let
|
|
70
|
+
var je = Object.defineProperty, Fe = (n, e, t) => e in n ? je(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, re = (n, e, t) => Fe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
71
|
+
let Be = 0, We = class {
|
|
72
72
|
constructor(e) {
|
|
73
|
-
|
|
73
|
+
re(this, "id"), re(this, "observers", /* @__PURE__ */ new Set()), re(this, "_value"), this.id = ++Be, this._value = e;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Get the current value and track dependency
|
|
77
77
|
*/
|
|
78
78
|
getValue() {
|
|
79
|
-
const e =
|
|
80
|
-
return e && e.state !==
|
|
79
|
+
const e = we();
|
|
80
|
+
return e && e.state !== y.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Get the current value without tracking dependency
|
|
@@ -97,7 +97,7 @@ let Se = 0, Ce = class {
|
|
|
97
97
|
*/
|
|
98
98
|
notify() {
|
|
99
99
|
for (const e of this.observers)
|
|
100
|
-
e.state !==
|
|
100
|
+
e.state !== y.Disposed && (e.state = y.Dirty, Ue(e));
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Remove an observer (cleanup)
|
|
@@ -117,28 +117,28 @@ let Se = 0, Ce = class {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
const
|
|
121
|
-
let
|
|
122
|
-
function
|
|
123
|
-
|
|
120
|
+
const X = /* @__PURE__ */ new Set();
|
|
121
|
+
let J = !1;
|
|
122
|
+
function Ue(n) {
|
|
123
|
+
X.add(n), !J && queueMicrotask(qe);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
if (!
|
|
127
|
-
|
|
125
|
+
function qe() {
|
|
126
|
+
if (!J) {
|
|
127
|
+
J = !0;
|
|
128
128
|
try {
|
|
129
|
-
for (;
|
|
130
|
-
const n = Array.from(
|
|
131
|
-
|
|
129
|
+
for (; X.size > 0; ) {
|
|
130
|
+
const n = Array.from(X).sort((e, t) => e.id - t.id);
|
|
131
|
+
X.clear();
|
|
132
132
|
for (const e of n)
|
|
133
|
-
e.state ===
|
|
133
|
+
e.state === y.Dirty && e.execute();
|
|
134
134
|
}
|
|
135
135
|
} finally {
|
|
136
|
-
|
|
136
|
+
J = !1;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
const e = new
|
|
140
|
+
function le(n) {
|
|
141
|
+
const e = new We(n), t = e.getValue.bind(e);
|
|
142
142
|
t.peek = e.peek.bind(e);
|
|
143
143
|
const s = e.set.bind(e);
|
|
144
144
|
return Object.defineProperty(t, Symbol.for("tachui.signal"), {
|
|
@@ -146,24 +146,24 @@ function G(n) {
|
|
|
146
146
|
enumerable: !1
|
|
147
147
|
}), [t, s];
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function F(n) {
|
|
150
150
|
return typeof n == "function" && Symbol.for("tachui.signal") in n;
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
var
|
|
154
|
-
let
|
|
152
|
+
const Qe = (n, e) => n === e;
|
|
153
|
+
var Ge = Object.defineProperty, Ke = (n, e, t) => e in n ? Ge(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, A = (n, e, t) => Ke(n, typeof e != "symbol" ? e + "" : e, t), G = /* @__PURE__ */ ((n) => (n[n.Immediate = 0] = "Immediate", n[n.High = 1] = "High", n[n.Normal = 2] = "Normal", n[n.Low = 3] = "Low", n[n.Idle = 4] = "Idle", n))(G || {});
|
|
154
|
+
let Ye = class extends Error {
|
|
155
155
|
constructor(e, t, s) {
|
|
156
156
|
super(e), this.cause = t, this.node = s, this.name = "ReactiveError";
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
|
-
const
|
|
159
|
+
const Ze = class _ {
|
|
160
160
|
constructor() {
|
|
161
|
-
|
|
162
|
-
for (const e of Object.values(
|
|
161
|
+
A(this, "updateQueues", /* @__PURE__ */ new Map()), A(this, "isFlushPending", !1), A(this, "isDestroyed", !1), A(this, "errorHandlers", /* @__PURE__ */ new Set()), A(this, "maxRetries", 3), A(this, "totalUpdateCycles", 0), A(this, "totalUpdateTime", 0), A(this, "errorCount", 0), A(this, "nodeRegistry", /* @__PURE__ */ new WeakSet());
|
|
162
|
+
for (const e of Object.values(G))
|
|
163
163
|
typeof e == "number" && this.updateQueues.set(e, /* @__PURE__ */ new Set());
|
|
164
164
|
}
|
|
165
165
|
static getInstance() {
|
|
166
|
-
return
|
|
166
|
+
return _.instance || (_.instance = new _()), _.instance;
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
169
|
* Schedule reactive node for update
|
|
@@ -196,7 +196,7 @@ const xe = class $ {
|
|
|
196
196
|
await this.updateNodeWithRetry(i);
|
|
197
197
|
} catch (o) {
|
|
198
198
|
this.handleReactiveError(
|
|
199
|
-
new
|
|
199
|
+
new Ye(`Failed to update ${i.type} node ${i.id}`, o, i)
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
202
|
if (this.hasHigherPriorityWork(t))
|
|
@@ -342,7 +342,7 @@ const xe = class $ {
|
|
|
342
342
|
}
|
|
343
343
|
e.clear();
|
|
344
344
|
}
|
|
345
|
-
this.updateQueues.clear(), this.errorHandlers.clear(),
|
|
345
|
+
this.updateQueues.clear(), this.errorHandlers.clear(), _.instance = null;
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
348
|
* Get debug information
|
|
@@ -350,7 +350,7 @@ const xe = class $ {
|
|
|
350
350
|
getDebugInfo() {
|
|
351
351
|
const e = {};
|
|
352
352
|
for (const [t, s] of this.updateQueues)
|
|
353
|
-
e[
|
|
353
|
+
e[G[t]] = s.size;
|
|
354
354
|
return {
|
|
355
355
|
isFlushPending: this.isFlushPending,
|
|
356
356
|
isDestroyed: this.isDestroyed,
|
|
@@ -360,35 +360,35 @@ const xe = class $ {
|
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
|
|
364
|
-
var
|
|
365
|
-
let
|
|
366
|
-
constructor(e, t = {}, s =
|
|
367
|
-
super(e, s),
|
|
363
|
+
A(Ze, "instance", null);
|
|
364
|
+
var Xe = Object.defineProperty, Je = (n, e, t) => e in n ? Xe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, L = (n, e, t) => Je(n, typeof e != "symbol" ? e + "" : e, t);
|
|
365
|
+
let et = class extends Ee {
|
|
366
|
+
constructor(e, t = {}, s = Ce()) {
|
|
367
|
+
super(e, s), L(this, "type", "computed"), L(this, "priority"), L(this, "_hasValue", !1), L(this, "_error", null), L(this, "equalsFn"), L(this, "options"), this.priority = t.priority ?? G.Normal, this.equalsFn = t.equals ?? Qe, this.options = t;
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
370
|
* Get the computed value, tracking dependency and lazily computing
|
|
371
371
|
*/
|
|
372
372
|
getValue() {
|
|
373
|
-
const e =
|
|
374
|
-
return e && e.state !==
|
|
373
|
+
const e = we();
|
|
374
|
+
return e && e.state !== y.Disposed && (this.observers.add(e), e.sources.add(this)), (this.state === y.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
|
|
375
375
|
}
|
|
376
376
|
/**
|
|
377
377
|
* Get the current value without tracking dependency
|
|
378
378
|
*/
|
|
379
379
|
peek() {
|
|
380
|
-
return (this.state ===
|
|
380
|
+
return (this.state === y.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
|
|
381
381
|
}
|
|
382
382
|
/**
|
|
383
383
|
* Remove an observer (cleanup)
|
|
384
384
|
*/
|
|
385
385
|
removeObserver(e) {
|
|
386
|
-
this.observers.delete(e), this.options.releaseOnNoObservers === !0 && this.observers.size === 0 && e.state ===
|
|
386
|
+
this.observers.delete(e), this.options.releaseOnNoObservers === !0 && this.observers.size === 0 && e.state === y.Disposed && this.releaseSources();
|
|
387
387
|
}
|
|
388
388
|
releaseSources() {
|
|
389
389
|
for (const e of this.sources)
|
|
390
390
|
"removeObserver" in e && e.removeObserver(this);
|
|
391
|
-
this.sources.clear(), this._hasValue = !1, this.state =
|
|
391
|
+
this.sources.clear(), this._hasValue = !1, this.state = y.Dirty;
|
|
392
392
|
}
|
|
393
393
|
/**
|
|
394
394
|
* Execute the computation and notify observers
|
|
@@ -397,8 +397,8 @@ let Re = class extends oe {
|
|
|
397
397
|
const e = this._hasValue ? this.value : void 0, t = super.execute();
|
|
398
398
|
if (!this._hasValue || !this.equalsFn(e, t))
|
|
399
399
|
for (const s of this.observers)
|
|
400
|
-
s.state !==
|
|
401
|
-
s.state ===
|
|
400
|
+
s.state !== y.Disposed && (s.state = y.Dirty, "execute" in s && typeof s.execute == "function" && queueMicrotask(() => {
|
|
401
|
+
s.state === y.Dirty && s.execute();
|
|
402
402
|
}));
|
|
403
403
|
return t;
|
|
404
404
|
}
|
|
@@ -417,7 +417,7 @@ let Re = class extends oe {
|
|
|
417
417
|
this.sources.clear();
|
|
418
418
|
for (const e of this.observers)
|
|
419
419
|
e.sources.delete(this);
|
|
420
|
-
this.observers.clear(), this._hasValue = !1, this._error = null, this.state =
|
|
420
|
+
this.observers.clear(), this._hasValue = !1, this._error = null, this.state = y.Disposed;
|
|
421
421
|
}
|
|
422
422
|
/**
|
|
423
423
|
* Dispose the computed value
|
|
@@ -438,7 +438,7 @@ let Re = class extends oe {
|
|
|
438
438
|
state: this.state,
|
|
439
439
|
sourceCount: this.sources.size,
|
|
440
440
|
observerCount: this.observers.size,
|
|
441
|
-
priority:
|
|
441
|
+
priority: G[this.priority],
|
|
442
442
|
debugName: this.options.debugName,
|
|
443
443
|
equalsFn: this.equalsFn.name || "anonymous"
|
|
444
444
|
};
|
|
@@ -447,29 +447,29 @@ let Re = class extends oe {
|
|
|
447
447
|
return `Computed(${this.options.debugName || this.id}): ${this._hasValue ? this.value : "no value"}`;
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
|
-
function
|
|
451
|
-
const t = new
|
|
450
|
+
function tt(n, e) {
|
|
451
|
+
const t = new et(n, e), s = t.getValue.bind(t);
|
|
452
452
|
return s.peek = t.peek.bind(t), Object.defineProperty(s, Symbol.for("tachui.computed"), {
|
|
453
453
|
value: t,
|
|
454
454
|
enumerable: !1
|
|
455
455
|
}), s;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function B(n) {
|
|
458
458
|
return typeof n == "function" && Symbol.for("tachui.computed") in n;
|
|
459
459
|
}
|
|
460
|
-
const [
|
|
461
|
-
|
|
462
|
-
const n =
|
|
463
|
-
return n === "system" ?
|
|
460
|
+
const [st, Ss] = le("light");
|
|
461
|
+
tt(() => {
|
|
462
|
+
const n = st();
|
|
463
|
+
return n === "system" ? rt() : n;
|
|
464
464
|
});
|
|
465
|
-
function
|
|
465
|
+
function rt() {
|
|
466
466
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
467
467
|
}
|
|
468
468
|
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = process.env.NODE_ENV !== "production");
|
|
469
|
-
var
|
|
470
|
-
let
|
|
469
|
+
var it = Object.defineProperty, nt = (n, e, t) => e in n ? it(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ve = (n, e, t) => nt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
470
|
+
let ot = class {
|
|
471
471
|
constructor() {
|
|
472
|
-
|
|
472
|
+
ve(this, "pending", /* @__PURE__ */ new Set()), ve(this, "isFlushScheduled", !1);
|
|
473
473
|
}
|
|
474
474
|
schedule(e) {
|
|
475
475
|
this.pending.add(e), this.isFlushScheduled || (this.isFlushScheduled = !0, queueMicrotask(() => this.flush()));
|
|
@@ -490,17 +490,17 @@ let De = class {
|
|
|
490
490
|
this.pending.size > 0 && (this.isFlushScheduled = !0, queueMicrotask(() => this.flush()));
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
new
|
|
494
|
-
let
|
|
495
|
-
const
|
|
493
|
+
new ot();
|
|
494
|
+
let ie = null;
|
|
495
|
+
const b = class b {
|
|
496
496
|
constructor() {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
497
|
+
m(this, "instanceId");
|
|
498
|
+
m(this, "createdAt");
|
|
499
|
+
m(this, "modifiers", /* @__PURE__ */ new Map());
|
|
500
|
+
m(this, "lazyLoaders", /* @__PURE__ */ new Map());
|
|
501
|
+
m(this, "loadingPromises", /* @__PURE__ */ new Map());
|
|
502
502
|
// Feature flags
|
|
503
|
-
|
|
503
|
+
m(this, "featureFlags", {
|
|
504
504
|
proxyModifiers: !1,
|
|
505
505
|
// Disabled by default for safe rollout
|
|
506
506
|
autoTypeGeneration: !1,
|
|
@@ -511,35 +511,35 @@ const y = class y {
|
|
|
511
511
|
// Enable for new system
|
|
512
512
|
});
|
|
513
513
|
// Metadata storage for type generation
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
m(this, "metadata", /* @__PURE__ */ new Map());
|
|
515
|
+
m(this, "metadataHistory", /* @__PURE__ */ new Map());
|
|
516
|
+
m(this, "conflicts", /* @__PURE__ */ new Map());
|
|
517
517
|
// Plugin metadata storage
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
`🏗️ ModifierRegistry instance created: ${this.instanceId} (total: ${
|
|
518
|
+
m(this, "plugins", /* @__PURE__ */ new Map());
|
|
519
|
+
b.instanceCount++, this.instanceId = Math.random().toString(36).substr(2, 9), this.createdAt = Date.now(), process.env.NODE_ENV === "development" && console.log(
|
|
520
|
+
`🏗️ ModifierRegistry instance created: ${this.instanceId} (total: ${b.instanceCount})`
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
523
|
static validateModifierName(e, t = {}) {
|
|
524
|
-
if (
|
|
524
|
+
if (b.FORBIDDEN_NAMES.has(e))
|
|
525
525
|
throw new Error(
|
|
526
526
|
`Security Error: Cannot register modifier '${e}' (forbidden name)`
|
|
527
527
|
);
|
|
528
|
-
if (!
|
|
528
|
+
if (!b.NAME_PATTERN.test(e)) {
|
|
529
529
|
if (t.strict)
|
|
530
530
|
throw new Error(
|
|
531
|
-
`Invalid modifier name '${e}'. Modifier names must match ${
|
|
531
|
+
`Invalid modifier name '${e}'. Modifier names must match ${b.NAME_PATTERN}`
|
|
532
532
|
);
|
|
533
533
|
process.env.NODE_ENV !== "production" && console.warn(
|
|
534
|
-
`⚠️ Modifier name '${e}' does not match ${
|
|
534
|
+
`⚠️ Modifier name '${e}' does not match ${b.NAME_PATTERN}. Prefer alphanumeric names for best tooling support.`
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
register(e, t) {
|
|
539
|
-
|
|
539
|
+
b.validateModifierName(e), this.modifiers.set(e, t), this.lazyLoaders.delete(e), this.loadingPromises.delete(e);
|
|
540
540
|
}
|
|
541
541
|
registerLazy(e, t) {
|
|
542
|
-
if (
|
|
542
|
+
if (b.validateModifierName(e), this.modifiers.has(e)) {
|
|
543
543
|
process.env.NODE_ENV === "development" && console.warn(
|
|
544
544
|
`⚠️ Modifier '${e}' already registered, skipping lazy registration`
|
|
545
545
|
);
|
|
@@ -610,7 +610,7 @@ const y = class y {
|
|
|
610
610
|
);
|
|
611
611
|
}
|
|
612
612
|
reset() {
|
|
613
|
-
this.clear(), process.env.NODE_ENV === "test" && (
|
|
613
|
+
this.clear(), process.env.NODE_ENV === "test" && (b.instanceCount = 0);
|
|
614
614
|
}
|
|
615
615
|
validateRegistry() {
|
|
616
616
|
const e = this.list(), t = e.filter(
|
|
@@ -623,7 +623,7 @@ const y = class y {
|
|
|
623
623
|
// Could be enhanced to scan for broken references
|
|
624
624
|
instanceId: this.instanceId,
|
|
625
625
|
createdAt: this.createdAt,
|
|
626
|
-
instanceCount:
|
|
626
|
+
instanceCount: b.instanceCount
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
629
|
/**
|
|
@@ -684,7 +684,7 @@ const y = class y {
|
|
|
684
684
|
throw new Error(
|
|
685
685
|
`Modifier metadata '${String(e.name)}' must include a plugin identifier`
|
|
686
686
|
);
|
|
687
|
-
typeof e.name == "string" &&
|
|
687
|
+
typeof e.name == "string" && b.validateModifierName(e.name, {
|
|
688
688
|
strict: !0
|
|
689
689
|
});
|
|
690
690
|
const t = this.metadata.get(e.name), s = t?.plugin === e.plugin;
|
|
@@ -771,7 +771,7 @@ const y = class y {
|
|
|
771
771
|
return Array.from(this.plugins.values());
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
|
-
|
|
774
|
+
m(b, "instanceCount", 0), m(b, "FORBIDDEN_NAMES", /* @__PURE__ */ new Set([
|
|
775
775
|
"__proto__",
|
|
776
776
|
"constructor",
|
|
777
777
|
"prototype",
|
|
@@ -779,29 +779,593 @@ u(y, "instanceCount", 0), u(y, "FORBIDDEN_NAMES", /* @__PURE__ */ new Set([
|
|
|
779
779
|
"isPrototypeOf",
|
|
780
780
|
"toString",
|
|
781
781
|
"valueOf"
|
|
782
|
-
])),
|
|
783
|
-
let
|
|
784
|
-
function
|
|
785
|
-
return
|
|
782
|
+
])), m(b, "NAME_PATTERN", /^[a-zA-Z_$][a-zA-Z0-9_$]*$/);
|
|
783
|
+
let ce = b;
|
|
784
|
+
function at() {
|
|
785
|
+
return ie || (ie = new ce()), ie;
|
|
786
786
|
}
|
|
787
|
-
const
|
|
788
|
-
function
|
|
789
|
-
const t =
|
|
787
|
+
const I = at();
|
|
788
|
+
function T(n, e = {}) {
|
|
789
|
+
const t = Ce();
|
|
790
790
|
let s;
|
|
791
791
|
const r = () => {
|
|
792
792
|
const o = n(s);
|
|
793
793
|
return s = o, o;
|
|
794
|
-
}, i = new
|
|
794
|
+
}, i = new Ee(r, t);
|
|
795
795
|
return e.name && Object.defineProperty(i, "name", {
|
|
796
796
|
value: e.name,
|
|
797
797
|
enumerable: !1
|
|
798
798
|
}), i.execute(), i;
|
|
799
799
|
}
|
|
800
|
+
var lt = Object.defineProperty, ct = (n, e, t) => e in n ? lt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ht = (n, e, t) => ct(n, e + "", t);
|
|
801
|
+
const dt = /* @__PURE__ */ new Set([
|
|
802
|
+
"onFocus",
|
|
803
|
+
"onBlur",
|
|
804
|
+
"onKeyDown",
|
|
805
|
+
"onKeyUp",
|
|
806
|
+
"onKeyPress",
|
|
807
|
+
"onScroll",
|
|
808
|
+
"onWheel",
|
|
809
|
+
"onInput",
|
|
810
|
+
"onChange",
|
|
811
|
+
"onCopy",
|
|
812
|
+
"onCut",
|
|
813
|
+
"onPaste",
|
|
814
|
+
"onSelect",
|
|
815
|
+
"onTouchStart",
|
|
816
|
+
"onTouchMove",
|
|
817
|
+
"onTouchEnd",
|
|
818
|
+
"onSwipeLeft",
|
|
819
|
+
"onSwipeRight"
|
|
820
|
+
]);
|
|
821
|
+
function Ae() {
|
|
822
|
+
return I;
|
|
823
|
+
}
|
|
824
|
+
function d(n, ...e) {
|
|
825
|
+
const t = Ae().get(n);
|
|
826
|
+
if (t)
|
|
827
|
+
try {
|
|
828
|
+
return t.apply(null, e);
|
|
829
|
+
} catch (s) {
|
|
830
|
+
throw console.warn(`Error creating modifier '${n}':`, s), s;
|
|
831
|
+
}
|
|
832
|
+
throw new Error(
|
|
833
|
+
`Modifier '${n}' not found in registry. Import @tachui/modifiers or @tachui/modifiers/effects to register modifiers.`
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
let ut = class {
|
|
837
|
+
constructor(e) {
|
|
838
|
+
this.component = e, ht(this, "modifiers", []);
|
|
839
|
+
}
|
|
840
|
+
frame(e, t) {
|
|
841
|
+
let s;
|
|
842
|
+
return typeof e == "object" ? s = e : (s = {}, e !== void 0 && (s.width = e), t !== void 0 && (s.height = t)), this.modifiers.push(d("frame", s)), this;
|
|
843
|
+
}
|
|
844
|
+
// margin() moved to @tachui/modifiers - available via Proxy when imported
|
|
845
|
+
layoutPriority(e) {
|
|
846
|
+
return this.modifiers.push(d("layoutPriority", e)), this;
|
|
847
|
+
}
|
|
848
|
+
// Size, padding, and margin modifiers moved to @tachui/modifiers
|
|
849
|
+
// All available via Proxy when @tachui/modifiers is imported:
|
|
850
|
+
// - size(), width(), height(), minWidth(), maxWidth(), minHeight(), maxHeight()
|
|
851
|
+
// - padding(), paddingTop(), paddingBottom(), paddingLeft(), paddingRight()
|
|
852
|
+
// - paddingLeading(), paddingTrailing(), paddingHorizontal(), paddingVertical()
|
|
853
|
+
// - marginTop(), marginBottom(), marginLeft(), marginRight()
|
|
854
|
+
// - marginHorizontal(), marginVertical()
|
|
855
|
+
// Typography modifiers moved to @tachui/modifiers:
|
|
856
|
+
// typography(), textAlign(), textTransform(), gradientText()
|
|
857
|
+
// Available via Proxy when @tachui/modifiers is imported
|
|
858
|
+
// Text modifiers (lineClamp, wordBreak, overflowWrap, hyphens) moved to @tachui/modifiers
|
|
859
|
+
// Available via Proxy when @tachui/modifiers is imported
|
|
860
|
+
// position() and zIndex() methods have been migrated to @tachui/modifiers/layout
|
|
861
|
+
// for enhanced SwiftUI-compatible functionality
|
|
862
|
+
// Text spacing and overflow methods moved to @tachui/modifiers:
|
|
863
|
+
// letterSpacing(), lineHeight(), textOverflow(), whiteSpace(), overflow()
|
|
864
|
+
// Border modifiers moved to @tachui/modifiers:
|
|
865
|
+
// borderTop(), borderRight(), borderBottom(), borderLeft()
|
|
866
|
+
// Flexbox modifiers moved to @tachui/modifiers:
|
|
867
|
+
// flexGrow(), flexShrink(), justifyContent(), alignItems(), gap(), flexDirection(), flexWrap()
|
|
868
|
+
// Utility modifiers moved to @tachui/modifiers:
|
|
869
|
+
// cursor(), overflowX(), overflowY(), outline(), outlineOffset(), display()
|
|
870
|
+
// Raw CSS modifiers moved to @tachui/modifiers/utility
|
|
871
|
+
// Import { css } from '@tachui/modifiers/utility' and apply explicitly.
|
|
872
|
+
// textCase(), textDecoration(), and aspectRatio() moved to @tachui/modifiers
|
|
873
|
+
// Available via Proxy when @tachui/modifiers is imported
|
|
874
|
+
// Phase 1 SwiftUI modifiers
|
|
875
|
+
// Note: clipped() has been moved to @tachui/modifiers
|
|
876
|
+
// Phase 2 SwiftUI modifiers
|
|
877
|
+
// Note: clipShape() and overlay() have been moved to @tachui/modifiers
|
|
878
|
+
// Phase 3 SwiftUI modifiers - Critical Transform Modifiers
|
|
879
|
+
absolutePosition(e, t) {
|
|
880
|
+
return this.modifiers.push(d("absolutePosition", e, t)), this;
|
|
881
|
+
}
|
|
882
|
+
// Appearance modifiers
|
|
883
|
+
foregroundColor(e) {
|
|
884
|
+
return this.modifiers.push(d("foregroundColor", e)), this;
|
|
885
|
+
}
|
|
886
|
+
backgroundColor(e) {
|
|
887
|
+
return this.modifiers.push(d("backgroundColor", e)), this;
|
|
888
|
+
}
|
|
889
|
+
background(e) {
|
|
890
|
+
const t = d("background", e);
|
|
891
|
+
return this.modifiers.push(t), this;
|
|
892
|
+
}
|
|
893
|
+
font(e) {
|
|
894
|
+
let t;
|
|
895
|
+
return typeof e == "object" ? (t = e, t.family !== void 0 && this.modifiers.push(
|
|
896
|
+
d("fontFamily", t.family)
|
|
897
|
+
), t.size !== void 0 && this.modifiers.push(d("fontSize", t.size)), t.weight !== void 0 && this.modifiers.push(d("fontWeight", t.weight)), t.style !== void 0 && this.modifiers.push(d("fontStyle", t.style))) : (t = e !== void 0 ? { size: e } : {}, typeof e == "string" && e.startsWith(".") ? this.modifiers.push(d("fontPreset", e)) : t.size !== void 0 && this.modifiers.push(d("fontSize", t.size))), this;
|
|
898
|
+
}
|
|
899
|
+
fontWeight(e) {
|
|
900
|
+
return this.modifiers.push(d("fontWeight", e)), this;
|
|
901
|
+
}
|
|
902
|
+
fontSize(e) {
|
|
903
|
+
return this.modifiers.push(d("fontSize", e)), this;
|
|
904
|
+
}
|
|
905
|
+
fontFamily(e) {
|
|
906
|
+
return this.modifiers.push(d("fontFamily", e)), this;
|
|
907
|
+
}
|
|
908
|
+
opacity(e) {
|
|
909
|
+
return this.modifiers.push(d("opacity", e)), this;
|
|
910
|
+
}
|
|
911
|
+
cornerRadius(e) {
|
|
912
|
+
return this.modifiers.push(d("cornerRadius", e)), this;
|
|
913
|
+
}
|
|
914
|
+
border(e, t) {
|
|
915
|
+
let s;
|
|
916
|
+
return typeof e == "object" ? s = e : s = {
|
|
917
|
+
style: "solid",
|
|
918
|
+
...e !== void 0 && { width: e },
|
|
919
|
+
...t !== void 0 && { color: t }
|
|
920
|
+
}, this.modifiers.push(d("border", s)), this;
|
|
921
|
+
}
|
|
922
|
+
borderWidth(e) {
|
|
923
|
+
return this.modifiers.push(d("border", { width: e })), this;
|
|
924
|
+
}
|
|
925
|
+
// Shadow functionality moved to @tachui/modifiers/effects entry point
|
|
926
|
+
// Visual Effects Modifiers (Phase 2 - Epic: Butternut)
|
|
927
|
+
blur(e) {
|
|
928
|
+
return this.modifiers.push(d("blur", e)), this;
|
|
929
|
+
}
|
|
930
|
+
brightness(e) {
|
|
931
|
+
return this.modifiers.push(d("brightness", e)), this;
|
|
932
|
+
}
|
|
933
|
+
contrast(e) {
|
|
934
|
+
return this.modifiers.push(d("contrast", e)), this;
|
|
935
|
+
}
|
|
936
|
+
saturation(e) {
|
|
937
|
+
return this.modifiers.push(d("saturation", e)), this;
|
|
938
|
+
}
|
|
939
|
+
hueRotation(e) {
|
|
940
|
+
return this.modifiers.push(d("hueRotation", e)), this;
|
|
941
|
+
}
|
|
942
|
+
grayscale(e) {
|
|
943
|
+
return this.modifiers.push(d("grayscale", e)), this;
|
|
944
|
+
}
|
|
945
|
+
colorInvert(e = 1) {
|
|
946
|
+
return this.modifiers.push(d("colorInvert", e)), this;
|
|
947
|
+
}
|
|
948
|
+
// ============================================================================
|
|
949
|
+
// VISUAL EFFECTS MOVED TO @tachui/modifiers/effects ENTRY
|
|
950
|
+
// ============================================================================
|
|
951
|
+
//
|
|
952
|
+
// Visual effects have been extracted to @tachui/modifiers/effects for better tree-shaking
|
|
953
|
+
// Visual effects methods removed - use @tachui/modifiers/effects
|
|
954
|
+
// Advanced gesture and interaction modifiers moved to @tachui/modifiers
|
|
955
|
+
// Available via Proxy when @tachui/modifiers is imported:
|
|
956
|
+
// - onLongPressGesture(), keyboardShortcut(), focused(), focusable(), onContinuousHover()
|
|
957
|
+
highPriorityGesture(e, t) {
|
|
958
|
+
return this.modifiers.push(d("highPriorityGesture", e, t)), this;
|
|
959
|
+
}
|
|
960
|
+
simultaneousGesture(e, t) {
|
|
961
|
+
return this.modifiers.push(d("simultaneousGesture", e, t)), this;
|
|
962
|
+
}
|
|
963
|
+
// allowsHitTesting() moved to @tachui/modifiers - available via Proxy when imported
|
|
964
|
+
// Animation modifiers
|
|
965
|
+
transform(e) {
|
|
966
|
+
return this.modifiers.push(d("transform", e)), this;
|
|
967
|
+
}
|
|
968
|
+
animation(e) {
|
|
969
|
+
return this.modifiers.push(d("animation", e)), this;
|
|
970
|
+
}
|
|
971
|
+
// Lifecycle modifiers
|
|
972
|
+
task(e, t) {
|
|
973
|
+
return this.modifiers.push(
|
|
974
|
+
d("task", {
|
|
975
|
+
operation: e,
|
|
976
|
+
id: t?.id,
|
|
977
|
+
priority: t?.priority || "default"
|
|
978
|
+
})
|
|
979
|
+
), this;
|
|
980
|
+
}
|
|
981
|
+
// Custom modifier application
|
|
982
|
+
/**
|
|
983
|
+
* @deprecated DO NOT USE - This is an internal API only.
|
|
984
|
+
* Always use direct modifier methods instead of .modifier()
|
|
985
|
+
*
|
|
986
|
+
* BAD: component.modifier(padding(16))
|
|
987
|
+
* GOOD: component.padding(16)
|
|
988
|
+
*
|
|
989
|
+
* If you need a modifier from @tachui/modifiers, import and use it directly:
|
|
990
|
+
* BAD: component.modifier(shadow({ radius: 4 }))
|
|
991
|
+
* GOOD: import { shadow } from '@tachui/modifiers'
|
|
992
|
+
* const mod = shadow({ radius: 4 })
|
|
993
|
+
* // Then apply via registry or component method
|
|
994
|
+
*/
|
|
995
|
+
modifier(e) {
|
|
996
|
+
return process.env.NODE_ENV === "development" && console.warn(
|
|
997
|
+
`⚠️ .modifier() should NOT be used by developers.
|
|
998
|
+
Use direct modifier methods instead:
|
|
999
|
+
BAD: component.modifier(padding(16))
|
|
1000
|
+
GOOD: component.padding(16)
|
|
1001
|
+
|
|
1002
|
+
If the method doesn't exist on the component, import the modifier package:
|
|
1003
|
+
import { shadowModifier } from '@tachui/modifiers'
|
|
1004
|
+
|
|
1005
|
+
This method is for internal framework use only.`
|
|
1006
|
+
), this.modifiers.push(e), this;
|
|
1007
|
+
}
|
|
1008
|
+
// Public method to add a modifier (used by Proxy)
|
|
1009
|
+
addModifierInternal(e) {
|
|
1010
|
+
return this.modifiers.push(e), this;
|
|
1011
|
+
}
|
|
1012
|
+
// Resizable modifier for images
|
|
1013
|
+
resizable() {
|
|
1014
|
+
return this.modifiers.push(d("resizable")), this;
|
|
1015
|
+
}
|
|
1016
|
+
// Responsive Design Methods
|
|
1017
|
+
/**
|
|
1018
|
+
* Add modifier to internal list (used by responsive builder)
|
|
1019
|
+
*/
|
|
1020
|
+
addModifier(e) {
|
|
1021
|
+
if (this.modifiers.push(e), "modifiers" in this.component && Array.isArray(this.component.modifiers)) {
|
|
1022
|
+
const t = this.component;
|
|
1023
|
+
t.modifiers = [
|
|
1024
|
+
...t.modifiers,
|
|
1025
|
+
e
|
|
1026
|
+
];
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
// Responsive functionality moved to @tachui/responsive package
|
|
1030
|
+
// Interaction modifiers
|
|
1031
|
+
onTap(e) {
|
|
1032
|
+
return this.modifiers.push(d("onTap", e)), this;
|
|
1033
|
+
}
|
|
1034
|
+
onFocus(e) {
|
|
1035
|
+
return this.modifiers.push(d("onFocus", e)), this;
|
|
1036
|
+
}
|
|
1037
|
+
onBlur(e) {
|
|
1038
|
+
return this.modifiers.push(d("onBlur", e)), this;
|
|
1039
|
+
}
|
|
1040
|
+
onKeyDown(e) {
|
|
1041
|
+
return this.modifiers.push(d("onKeyDown", e)), this;
|
|
1042
|
+
}
|
|
1043
|
+
onScroll(e) {
|
|
1044
|
+
return this.modifiers.push(d("onScroll", e)), this;
|
|
1045
|
+
}
|
|
1046
|
+
onKeyPress(e) {
|
|
1047
|
+
return this.modifiers.push(d("onKeyPress", e)), this;
|
|
1048
|
+
}
|
|
1049
|
+
onKeyUp(e) {
|
|
1050
|
+
return this.modifiers.push(d("onKeyUp", e)), this;
|
|
1051
|
+
}
|
|
1052
|
+
onDoubleClick(e) {
|
|
1053
|
+
return this.modifiers.push(d("onDoubleClick", e)), this;
|
|
1054
|
+
}
|
|
1055
|
+
onContextMenu(e) {
|
|
1056
|
+
return this.modifiers.push(d("onContextMenu", e)), this;
|
|
1057
|
+
}
|
|
1058
|
+
onWheel(e) {
|
|
1059
|
+
return this.modifiers.push(d("onWheel", e)), this;
|
|
1060
|
+
}
|
|
1061
|
+
onInput(e) {
|
|
1062
|
+
return this.modifiers.push(d("onInput", e)), this;
|
|
1063
|
+
}
|
|
1064
|
+
onChange(e) {
|
|
1065
|
+
return this.modifiers.push(d("onChange", e)), this;
|
|
1066
|
+
}
|
|
1067
|
+
onCopy(e) {
|
|
1068
|
+
return this.modifiers.push(d("onCopy", e)), this;
|
|
1069
|
+
}
|
|
1070
|
+
onCut(e) {
|
|
1071
|
+
return this.modifiers.push(d("onCut", e)), this;
|
|
1072
|
+
}
|
|
1073
|
+
onPaste(e) {
|
|
1074
|
+
return this.modifiers.push(d("onPaste", e)), this;
|
|
1075
|
+
}
|
|
1076
|
+
onSelect(e) {
|
|
1077
|
+
return this.modifiers.push(d("onSelect", e)), this;
|
|
1078
|
+
}
|
|
1079
|
+
// Transition modifier moved to @tachui/modifiers:
|
|
1080
|
+
// transition()
|
|
1081
|
+
// HTML and ARIA Attributes moved to @tachui/modifiers
|
|
1082
|
+
// Available via Proxy when @tachui/modifiers is imported:
|
|
1083
|
+
// - id(), data(), aria(), tabIndex()
|
|
1084
|
+
customProperties(e) {
|
|
1085
|
+
throw new Error(
|
|
1086
|
+
'CSS property modifiers have been moved to @tachui/modifiers. Please import { customProperties } from "@tachui/modifiers" and use it directly instead of chaining it on components.'
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
customProperty(e, t) {
|
|
1090
|
+
throw new Error(
|
|
1091
|
+
'CSS property modifiers have been moved to @tachui/modifiers. Please import { customProperty } from "@tachui/modifiers" and use it directly instead of chaining it on components.'
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
cssVariables(e) {
|
|
1095
|
+
throw new Error(
|
|
1096
|
+
'CSS property modifiers have been moved to @tachui/modifiers. Please import { cssVariables } from "@tachui/modifiers" and use it directly instead of chaining it on components.'
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
themeColors(e) {
|
|
1100
|
+
throw new Error(
|
|
1101
|
+
'Theme modifiers have been moved to @tachui/modifiers. Please import { themeColors } from "@tachui/modifiers" and use it directly instead of chaining it on components.'
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
designTokens(e) {
|
|
1105
|
+
throw new Error(
|
|
1106
|
+
'Design token modifiers have been moved to @tachui/modifiers. Please import { designTokens } from "@tachui/modifiers" and use it directly instead of chaining it on components.'
|
|
1107
|
+
);
|
|
1108
|
+
}
|
|
1109
|
+
// State modifiers
|
|
1110
|
+
disabled(e = !0) {
|
|
1111
|
+
return this.modifiers.push(d("disabled", e)), this;
|
|
1112
|
+
}
|
|
1113
|
+
asHTML(e) {
|
|
1114
|
+
const t = d("asHTML", e);
|
|
1115
|
+
return this.modifiers.push(t), this;
|
|
1116
|
+
}
|
|
1117
|
+
// Build the final component with all modifiers applied
|
|
1118
|
+
build() {
|
|
1119
|
+
if ("modifiers" in this.component) {
|
|
1120
|
+
const e = this.component, t = Array.isArray(
|
|
1121
|
+
e.modifiers
|
|
1122
|
+
) ? [...e.modifiers] : [], s = this.modifiers.filter(
|
|
1123
|
+
(a) => !e.modifiers.some(
|
|
1124
|
+
(h) => h === a
|
|
1125
|
+
// Reference equality check
|
|
1126
|
+
)
|
|
1127
|
+
), r = [...t, ...s], i = e._originalComponent || e;
|
|
1128
|
+
let o;
|
|
1129
|
+
if (typeof i?.clone == "function")
|
|
1130
|
+
o = i.clone();
|
|
1131
|
+
else {
|
|
1132
|
+
const a = i && Object.getPrototypeOf(i) || Object.prototype;
|
|
1133
|
+
o = Object.create(a), Object.assign(o, i), o.props = { ...i.props }, o.cleanup = Array.isArray(i.cleanup) ? [...i.cleanup] : [], o.mounted = i.mounted ?? !1, o.id = i.id, o.type = i.type, o.render = typeof i.render == "function" ? i.render.bind(i) : () => [];
|
|
1134
|
+
}
|
|
1135
|
+
const l = te(
|
|
1136
|
+
o,
|
|
1137
|
+
r
|
|
1138
|
+
);
|
|
1139
|
+
return process.env.NODE_ENV === "test" && this.applyModifiersToPropsForTesting(
|
|
1140
|
+
l,
|
|
1141
|
+
r
|
|
1142
|
+
), l;
|
|
1143
|
+
} else {
|
|
1144
|
+
const e = te(
|
|
1145
|
+
this.component,
|
|
1146
|
+
this.modifiers
|
|
1147
|
+
);
|
|
1148
|
+
return process.env.NODE_ENV === "test" && this.applyModifiersToPropsForTesting(
|
|
1149
|
+
e,
|
|
1150
|
+
this.modifiers
|
|
1151
|
+
), e;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
applyModifiersToPropsForTesting(e, t) {
|
|
1155
|
+
e.props || (e.props = {}), t.forEach((s) => {
|
|
1156
|
+
if (s.type === "aria") {
|
|
1157
|
+
const r = s.properties?.aria || {};
|
|
1158
|
+
Object.entries(r).forEach(([i, o]) => {
|
|
1159
|
+
if (o != null)
|
|
1160
|
+
if (i === "role")
|
|
1161
|
+
e.props.role = o;
|
|
1162
|
+
else {
|
|
1163
|
+
const l = i.startsWith("aria-") ? i : `aria-${i}`;
|
|
1164
|
+
e.props[l] = typeof o == "boolean" ? o : String(o);
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
} else if (dt.has(s.type)) {
|
|
1168
|
+
const r = s.properties || {};
|
|
1169
|
+
Object.entries(r).forEach(([i, o]) => {
|
|
1170
|
+
typeof o == "function" && (e.props[i] = o);
|
|
1171
|
+
});
|
|
1172
|
+
} else if (s.type === "interaction") {
|
|
1173
|
+
const r = s.properties;
|
|
1174
|
+
Object.entries(r).forEach(([i, o]) => {
|
|
1175
|
+
typeof o == "function" && (e.props[i] = o);
|
|
1176
|
+
}), (r.onSwipeLeft || r.onSwipeRight) && (e.props.onTouchStart = () => {
|
|
1177
|
+
});
|
|
1178
|
+
} else if (s.type === "utility") {
|
|
1179
|
+
const r = s.properties;
|
|
1180
|
+
e.props.style || (e.props.style = {}), Object.entries(r).forEach(([i, o]) => {
|
|
1181
|
+
o != null && (e.props.style[i] = o);
|
|
1182
|
+
});
|
|
1183
|
+
} else if (s.type === "tabIndex") {
|
|
1184
|
+
const r = s;
|
|
1185
|
+
e.props.tabIndex = r.properties?.tabIndex;
|
|
1186
|
+
} else if (s.type === "appearance") {
|
|
1187
|
+
const r = s.properties;
|
|
1188
|
+
e.props.style || (e.props.style = {}), r.backgroundColor && (e.props.style.backgroundColor = r.backgroundColor), r.foregroundColor && (e.props.style.color = r.foregroundColor), r.opacity !== void 0 && (e.props.style.opacity = r.opacity), r.role !== void 0 && (e.props.role = String(r.role)), r["aria-label"] !== void 0 && (e.props["aria-label"] = String(r["aria-label"])), r["aria-live"] !== void 0 && (e.props["aria-live"] = String(r["aria-live"])), r["aria-describedby"] !== void 0 && (e.props["aria-describedby"] = String(
|
|
1189
|
+
r["aria-describedby"]
|
|
1190
|
+
)), r["aria-modal"] !== void 0 && (e.props["aria-modal"] = r["aria-modal"] === "true" || r["aria-modal"] === !0), r["aria-hidden"] !== void 0 && (e.props["aria-hidden"] = String(r["aria-hidden"])), r.navigationTitle !== void 0 && (e.props.navigationTitle = String(r.navigationTitle)), r.navigationBarHidden !== void 0 && (e.props.navigationBarHidden = r.navigationBarHidden, r.navigationBarHidden && (e.props["aria-hidden"] = "true")), r.navigationBarItems !== void 0 && (e.props.navigationBarItems = r.navigationBarItems);
|
|
1191
|
+
} else if (s.type === "foreground") {
|
|
1192
|
+
const r = s.properties || {};
|
|
1193
|
+
r.color !== void 0 && (e.props.style || (e.props.style = {}), e.props.style.color = r.color);
|
|
1194
|
+
} else if (s.type === "background") {
|
|
1195
|
+
const r = s.properties || {};
|
|
1196
|
+
r.background !== void 0 && (e.props.style || (e.props.style = {}), e.props.style.background = r.background, typeof r.background == "string" && (e.props.style.backgroundColor = r.background));
|
|
1197
|
+
} else if (s.type === "transition") {
|
|
1198
|
+
const r = s.properties;
|
|
1199
|
+
e.props.style || (e.props.style = {}), r.transition && (e.props.style.transition = r.transition);
|
|
1200
|
+
} else if (s.type === "size") {
|
|
1201
|
+
const r = s.properties;
|
|
1202
|
+
e.props.style || (e.props.style = {}), r.minHeight !== void 0 && (e.props.style.minHeight = r.minHeight), r.minWidth !== void 0 && (e.props.style.minWidth = r.minWidth), r.maxHeight !== void 0 && (e.props.style.maxHeight = r.maxHeight), r.maxWidth !== void 0 && (e.props.style.maxWidth = r.maxWidth), r.width !== void 0 && (e.props.style.width = r.width), r.height !== void 0 && (e.props.style.height = r.height);
|
|
1203
|
+
} else if (s.type === "css") {
|
|
1204
|
+
const r = s.properties;
|
|
1205
|
+
e.props.style || (e.props.style = {}), Object.entries(r).forEach(([i, o]) => {
|
|
1206
|
+
o != null && (e.props.style[i] = o);
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
// ============================================================================
|
|
1212
|
+
// MISSING MODIFIER METHODS - ACCESSIBILITY & NAVIGATION
|
|
1213
|
+
// ============================================================================
|
|
1214
|
+
// Individual ARIA methods for better developer experience
|
|
1215
|
+
role(e) {
|
|
1216
|
+
return this.modifiers.push(d("role", e)), this;
|
|
1217
|
+
}
|
|
1218
|
+
ariaLabel(e) {
|
|
1219
|
+
return this.modifiers.push(d("ariaLabel", e)), this;
|
|
1220
|
+
}
|
|
1221
|
+
ariaLive(e) {
|
|
1222
|
+
return this.modifiers.push(d("ariaLive", e)), this;
|
|
1223
|
+
}
|
|
1224
|
+
ariaDescribedBy(e) {
|
|
1225
|
+
return this.modifiers.push(d("ariaDescribedBy", e)), this;
|
|
1226
|
+
}
|
|
1227
|
+
ariaModal(e) {
|
|
1228
|
+
return this.modifiers.push(d("ariaModal", e)), this;
|
|
1229
|
+
}
|
|
1230
|
+
// Touch and gesture events
|
|
1231
|
+
onTouchStart(e) {
|
|
1232
|
+
return this.modifiers.push(d("onTouchStart", e)), this;
|
|
1233
|
+
}
|
|
1234
|
+
onTouchMove(e) {
|
|
1235
|
+
return this.modifiers.push(d("onTouchMove", e)), this;
|
|
1236
|
+
}
|
|
1237
|
+
onTouchEnd(e) {
|
|
1238
|
+
return this.modifiers.push(d("onTouchEnd", e)), this;
|
|
1239
|
+
}
|
|
1240
|
+
// Swipe gestures (simplified implementations)
|
|
1241
|
+
onSwipeLeft(e) {
|
|
1242
|
+
return this.modifiers.push(d("onSwipeLeft", e)), this;
|
|
1243
|
+
}
|
|
1244
|
+
onSwipeRight(e) {
|
|
1245
|
+
return this.modifiers.push(d("onSwipeRight", e)), this;
|
|
1246
|
+
}
|
|
1247
|
+
// Navigation methods - these delegate to the navigation package functions
|
|
1248
|
+
navigationTitle(e) {
|
|
1249
|
+
return this.modifiers.push(d("navigationTitle", e)), this;
|
|
1250
|
+
}
|
|
1251
|
+
navigationBarHidden(e = !0) {
|
|
1252
|
+
return this.modifiers.push(d("navigationBarHidden", e)), this;
|
|
1253
|
+
}
|
|
1254
|
+
navigationBarItems(e) {
|
|
1255
|
+
return this.modifiers.push(d("navigationBarItems", e)), this;
|
|
1256
|
+
}
|
|
1257
|
+
// ============================================================================
|
|
1258
|
+
// MISSING TRANSITION METHODS
|
|
1259
|
+
// ============================================================================
|
|
1260
|
+
transitions(e) {
|
|
1261
|
+
return this.modifiers.push(d("transitions", e)), this;
|
|
1262
|
+
}
|
|
1263
|
+
// All transition methods moved to @tachui/modifiers:
|
|
1264
|
+
// fadeTransition(), transformTransition(), colorTransition(), layoutTransition(),
|
|
1265
|
+
// buttonTransition(), cardTransition(), modalTransition(), smoothTransition(),
|
|
1266
|
+
// quickTransition(), slowTransition()
|
|
1267
|
+
// ============================================================================
|
|
1268
|
+
// SCROLL METHODS - ALL MOVED TO @tachui/modifiers
|
|
1269
|
+
// ============================================================================
|
|
1270
|
+
// scroll(), scrollBehavior(), overscrollBehavior(), overscrollBehaviorX(),
|
|
1271
|
+
// overscrollBehaviorY(), scrollMargin(), scrollPadding(), scrollSnap()
|
|
1272
|
+
// ============================================================================
|
|
1273
|
+
// MIGRATED MODIFIERS - NOW IN SPECIALIZED PACKAGES
|
|
1274
|
+
// ============================================================================
|
|
1275
|
+
// Viewport lifecycle modifiers - moved to @tachui/viewport
|
|
1276
|
+
onAppear(e) {
|
|
1277
|
+
throw new Error(
|
|
1278
|
+
'onAppear modifier has been moved to @tachui/viewport. Please import { onAppear } from "@tachui/viewport/modifiers" and use it directly instead of chaining it on components.'
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
onDisappear(e) {
|
|
1282
|
+
throw new Error(
|
|
1283
|
+
'onDisappear modifier has been moved to @tachui/viewport. Please import { onDisappear } from "@tachui/viewport/modifiers" and use it directly instead of chaining it on components.'
|
|
1284
|
+
);
|
|
1285
|
+
}
|
|
1286
|
+
// Mobile gesture modifiers - moved to @tachui/mobile
|
|
1287
|
+
refreshable(e, t) {
|
|
1288
|
+
throw new Error(
|
|
1289
|
+
'refreshable modifier has been moved to @tachui/mobile. Please import { refreshable } from "@tachui/mobile/modifiers" and use it directly instead of chaining it on components.'
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
// onAppear and onDisappear have been moved to @tachui/viewport/modifiers
|
|
1293
|
+
// to maintain proper architectural boundaries
|
|
1294
|
+
// Transform modifiers
|
|
1295
|
+
scaleEffect(e, t, s) {
|
|
1296
|
+
return this.modifiers.push(d("scaleEffect", e, t, s)), this;
|
|
1297
|
+
}
|
|
1298
|
+
// Shadow and clipping modifiers moved to @tachui/modifiers
|
|
1299
|
+
// Available via Proxy when @tachui/modifiers is imported:
|
|
1300
|
+
// - shadow(), textShadow(), shadows(), shadowPreset(), clipped()
|
|
1301
|
+
};
|
|
1302
|
+
function pt(n) {
|
|
1303
|
+
const e = new ut(n);
|
|
1304
|
+
return new Proxy(e, {
|
|
1305
|
+
get(t, s, r) {
|
|
1306
|
+
if (s in t) {
|
|
1307
|
+
const i = t[s];
|
|
1308
|
+
return typeof i == "function" ? function(...o) {
|
|
1309
|
+
const l = i.apply(r, o);
|
|
1310
|
+
return l === t ? r : l;
|
|
1311
|
+
} : i;
|
|
1312
|
+
}
|
|
1313
|
+
if (typeof s == "string") {
|
|
1314
|
+
const i = Ae();
|
|
1315
|
+
if (s === "responsive")
|
|
1316
|
+
return function(...o) {
|
|
1317
|
+
const l = o[0];
|
|
1318
|
+
if (l) {
|
|
1319
|
+
const a = d(s, l);
|
|
1320
|
+
this.addModifierInternal(a);
|
|
1321
|
+
}
|
|
1322
|
+
return r;
|
|
1323
|
+
};
|
|
1324
|
+
if (s === "base" || s === "sm" || s === "md" || s === "lg" || s === "xl" || s === "2xl")
|
|
1325
|
+
return new Proxy({}, {
|
|
1326
|
+
get(o, l) {
|
|
1327
|
+
if (typeof l == "string")
|
|
1328
|
+
return (...a) => {
|
|
1329
|
+
const h = { [l]: { [s]: a[0] } }, c = d("responsive", h);
|
|
1330
|
+
return t.addModifierInternal(c), r;
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
if (i.has(s))
|
|
1335
|
+
return function(...o) {
|
|
1336
|
+
const l = d(s, ...o);
|
|
1337
|
+
return this.addModifierInternal(l), r;
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
class ft {
|
|
1344
|
+
register(e, t) {
|
|
1345
|
+
I.register(e, t);
|
|
1346
|
+
}
|
|
1347
|
+
get(e) {
|
|
1348
|
+
return I.get(e);
|
|
1349
|
+
}
|
|
1350
|
+
has(e) {
|
|
1351
|
+
return I.has(e);
|
|
1352
|
+
}
|
|
1353
|
+
list() {
|
|
1354
|
+
return I.list();
|
|
1355
|
+
}
|
|
1356
|
+
clear() {
|
|
1357
|
+
I.clear();
|
|
1358
|
+
}
|
|
1359
|
+
validateRegistry() {
|
|
1360
|
+
return I.validateRegistry();
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
const V = new ft();
|
|
800
1364
|
process.env.NODE_ENV === "development" && console.log("📤 Created RegistryAdapter for globalModifierRegistry", {
|
|
801
|
-
registryId:
|
|
802
|
-
currentSize:
|
|
1365
|
+
registryId: I.instanceId,
|
|
1366
|
+
currentSize: I.list().length
|
|
803
1367
|
});
|
|
804
|
-
function
|
|
1368
|
+
function Me(n, e, t = {}, s = {}) {
|
|
805
1369
|
if (!e.length) return n;
|
|
806
1370
|
const r = {
|
|
807
1371
|
componentId: t.componentId || "unknown",
|
|
@@ -817,51 +1381,51 @@ function Ve(n, e, t = {}, s = {}) {
|
|
|
817
1381
|
};
|
|
818
1382
|
switch (s.batch ? "batch" : "sequential") {
|
|
819
1383
|
case "batch":
|
|
820
|
-
return
|
|
1384
|
+
return gt(n, e, r, s);
|
|
821
1385
|
default:
|
|
822
|
-
return
|
|
1386
|
+
return mt(n, e, r, s);
|
|
823
1387
|
}
|
|
824
1388
|
}
|
|
825
|
-
function
|
|
1389
|
+
function mt(n, e, t, s) {
|
|
826
1390
|
const r = [...e].sort(
|
|
827
|
-
(
|
|
1391
|
+
(a, h) => a.priority - h.priority
|
|
828
1392
|
);
|
|
829
1393
|
let i = n;
|
|
830
|
-
const o = [],
|
|
831
|
-
for (const
|
|
1394
|
+
const o = [], l = [];
|
|
1395
|
+
for (const a of r)
|
|
832
1396
|
try {
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
} catch (
|
|
836
|
-
console.error(`Failed to apply modifier ${
|
|
1397
|
+
const h = a.apply(i, t);
|
|
1398
|
+
h && typeof h == "object" && "type" in h && (i = h), s.immediate && !s.suppressEffects && (o.forEach((c) => c()), o.length = 0);
|
|
1399
|
+
} catch (h) {
|
|
1400
|
+
console.error(`Failed to apply modifier ${a.type}:`, h);
|
|
837
1401
|
}
|
|
838
|
-
if (
|
|
839
|
-
const
|
|
1402
|
+
if (l.length > 0) {
|
|
1403
|
+
const a = i.dispose;
|
|
840
1404
|
i.dispose = () => {
|
|
841
|
-
|
|
1405
|
+
l.forEach((h) => h()), a && a();
|
|
842
1406
|
};
|
|
843
1407
|
}
|
|
844
1408
|
return i;
|
|
845
1409
|
}
|
|
846
|
-
function
|
|
847
|
-
const r =
|
|
1410
|
+
function gt(n, e, t, s) {
|
|
1411
|
+
const r = yt(e);
|
|
848
1412
|
let i = n;
|
|
849
|
-
const o = [],
|
|
850
|
-
for (const [
|
|
1413
|
+
const o = [], l = [];
|
|
1414
|
+
for (const [a, h] of r)
|
|
851
1415
|
try {
|
|
852
|
-
i =
|
|
853
|
-
} catch (
|
|
854
|
-
(typeof process > "u" || process.env.NODE_ENV !== "test") && console.error(`Failed to apply modifier group ${
|
|
1416
|
+
i = vt(i, h, t);
|
|
1417
|
+
} catch (c) {
|
|
1418
|
+
(typeof process > "u" || process.env.NODE_ENV !== "test") && console.error(`Failed to apply modifier group ${a}:`, c);
|
|
855
1419
|
}
|
|
856
|
-
if (s.suppressEffects || o.forEach((
|
|
857
|
-
const
|
|
1420
|
+
if (s.suppressEffects || o.forEach((a) => a()), l.length > 0) {
|
|
1421
|
+
const a = i.dispose;
|
|
858
1422
|
i.dispose = () => {
|
|
859
|
-
|
|
1423
|
+
l.forEach((h) => h()), a && a();
|
|
860
1424
|
};
|
|
861
1425
|
}
|
|
862
1426
|
return i;
|
|
863
1427
|
}
|
|
864
|
-
function
|
|
1428
|
+
function yt(n) {
|
|
865
1429
|
const e = /* @__PURE__ */ new Map();
|
|
866
1430
|
for (const t of n) {
|
|
867
1431
|
const s = e.get(t.type) || [];
|
|
@@ -869,7 +1433,7 @@ function Ue(n) {
|
|
|
869
1433
|
}
|
|
870
1434
|
return e;
|
|
871
1435
|
}
|
|
872
|
-
function
|
|
1436
|
+
function vt(n, e, t) {
|
|
873
1437
|
const s = [...e].sort(
|
|
874
1438
|
(i, o) => i.priority - o.priority
|
|
875
1439
|
);
|
|
@@ -883,7 +1447,80 @@ function je(n, e, t) {
|
|
|
883
1447
|
}
|
|
884
1448
|
return r;
|
|
885
1449
|
}
|
|
886
|
-
|
|
1450
|
+
function bt(n) {
|
|
1451
|
+
return n && typeof n.concat == "function" && typeof n.toSegment == "function" && typeof n.isConcatenatable == "function";
|
|
1452
|
+
}
|
|
1453
|
+
function te(n, e = []) {
|
|
1454
|
+
const t = {
|
|
1455
|
+
type: n.type,
|
|
1456
|
+
id: n.id,
|
|
1457
|
+
props: { ...n.props },
|
|
1458
|
+
mounted: n.mounted,
|
|
1459
|
+
cleanup: n.cleanup ? [...n.cleanup] : [],
|
|
1460
|
+
modifiers: [...e],
|
|
1461
|
+
modifierBuilder: null,
|
|
1462
|
+
// Will be set after component is created
|
|
1463
|
+
render: n.render ? n.render.bind(n) : () => [],
|
|
1464
|
+
// Bind to original component or provide default
|
|
1465
|
+
// Store reference to original component for modifier context
|
|
1466
|
+
_originalComponent: n
|
|
1467
|
+
};
|
|
1468
|
+
t.modifierBuilder = pt(
|
|
1469
|
+
t
|
|
1470
|
+
), t.modifier = t.modifierBuilder, Object.prototype.hasOwnProperty.call(n, "modifier") || Object.defineProperty(n, "modifier", {
|
|
1471
|
+
configurable: !0,
|
|
1472
|
+
enumerable: !1,
|
|
1473
|
+
get() {
|
|
1474
|
+
return t.modifierBuilder;
|
|
1475
|
+
}
|
|
1476
|
+
}), n.modifiableComponent = t;
|
|
1477
|
+
const s = n._enhancedLifecycle;
|
|
1478
|
+
s && (t._enhancedLifecycle = s, "domElements" in n && (t.domElements = n.domElements), "primaryElement" in n && (t.primaryElement = n.primaryElement), "domReady" in n && (t.domReady = n.domReady), "children" in n && (t.children = n.children));
|
|
1479
|
+
const r = n.render ? n.render.bind(n) : () => [];
|
|
1480
|
+
return t.render = () => {
|
|
1481
|
+
const i = r();
|
|
1482
|
+
return (Array.isArray(i) ? i : [i]).map((o, l) => (o && typeof o == "object" && (l === 0 ? (o.modifiers = [...t.modifiers], o.componentId = n.id, o._originalComponent = t._originalComponent) : (o.modifiers && delete o.modifiers, o.componentId && o.componentId === n.id && delete o.componentId)), o));
|
|
1483
|
+
}, bt(n) && (t.concat = function(i) {
|
|
1484
|
+
const o = {
|
|
1485
|
+
id: t.id,
|
|
1486
|
+
component: t,
|
|
1487
|
+
modifiers: t.modifiers,
|
|
1488
|
+
render: () => {
|
|
1489
|
+
const h = t.render();
|
|
1490
|
+
return Array.isArray(h) ? h[0] : h;
|
|
1491
|
+
}
|
|
1492
|
+
}, l = i.toSegment(), a = {
|
|
1493
|
+
totalSegments: i instanceof Y ? i.segments.length + 1 : 2,
|
|
1494
|
+
accessibilityRole: "text",
|
|
1495
|
+
// Simplified for now
|
|
1496
|
+
semanticStructure: "inline"
|
|
1497
|
+
// Simplified for now
|
|
1498
|
+
};
|
|
1499
|
+
return i instanceof Y ? new Y(
|
|
1500
|
+
[o, ...i.segments],
|
|
1501
|
+
a
|
|
1502
|
+
) : new Y([o, l], a);
|
|
1503
|
+
}, t.toSegment = function() {
|
|
1504
|
+
return {
|
|
1505
|
+
id: t.id,
|
|
1506
|
+
component: t,
|
|
1507
|
+
modifiers: t.modifiers,
|
|
1508
|
+
render: () => {
|
|
1509
|
+
const i = t.render();
|
|
1510
|
+
return Array.isArray(i) ? i[0] : i;
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
}, t.isConcatenatable = function() {
|
|
1514
|
+
return !0;
|
|
1515
|
+
}), typeof n?.clone == "function" && (t.clone = (i) => {
|
|
1516
|
+
const o = n.clone(i);
|
|
1517
|
+
return te(
|
|
1518
|
+
o,
|
|
1519
|
+
[...t.modifiers]
|
|
1520
|
+
);
|
|
1521
|
+
}), t;
|
|
1522
|
+
}
|
|
1523
|
+
const K = /* @__PURE__ */ new Map([
|
|
887
1524
|
["nav", { role: "navigation", applyARIA: !0 }],
|
|
888
1525
|
["main", { role: "main", applyARIA: !0 }],
|
|
889
1526
|
["article", { role: "article", applyARIA: !0 }],
|
|
@@ -901,28 +1538,28 @@ const H = /* @__PURE__ */ new Map([
|
|
|
901
1538
|
["a", { role: "link", applyARIA: !1 }]
|
|
902
1539
|
// Usually implicit
|
|
903
1540
|
]);
|
|
904
|
-
let
|
|
1541
|
+
let St = {
|
|
905
1542
|
autoApplySemanticRoles: !0,
|
|
906
1543
|
warnOnOverrides: process.env.NODE_ENV !== "production",
|
|
907
1544
|
warnOnSemanticIssues: process.env.NODE_ENV !== "production",
|
|
908
1545
|
validateTags: !0,
|
|
909
1546
|
allowInvalidTags: !0
|
|
910
1547
|
};
|
|
911
|
-
function
|
|
912
|
-
return { ...
|
|
1548
|
+
function wt() {
|
|
1549
|
+
return { ...St };
|
|
913
1550
|
}
|
|
914
|
-
var
|
|
915
|
-
const
|
|
1551
|
+
var Ct = Object.defineProperty, Et = (n, e, t) => e in n ? Ct(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, At = (n, e, t) => Et(n, e + "", t);
|
|
1552
|
+
const xe = class W {
|
|
916
1553
|
static getInstance() {
|
|
917
|
-
return
|
|
1554
|
+
return W.instance || (W.instance = new W()), W.instance;
|
|
918
1555
|
}
|
|
919
1556
|
/**
|
|
920
1557
|
* Apply semantic ARIA attributes to an element based on its tag
|
|
921
1558
|
*/
|
|
922
1559
|
applySemanticAttributes(e, t, s) {
|
|
923
|
-
const r =
|
|
1560
|
+
const r = wt();
|
|
924
1561
|
if (!r.autoApplySemanticRoles) return;
|
|
925
|
-
const i =
|
|
1562
|
+
const i = K.get(t);
|
|
926
1563
|
if (!(!i || !i.applyARIA)) {
|
|
927
1564
|
if (s?.role) {
|
|
928
1565
|
r.warnOnSemanticIssues && process.env.NODE_ENV !== "production" && console.warn(
|
|
@@ -943,20 +1580,20 @@ const ae = class L {
|
|
|
943
1580
|
* Get semantic role information for a tag
|
|
944
1581
|
*/
|
|
945
1582
|
getSemanticRole(e) {
|
|
946
|
-
return
|
|
1583
|
+
return K.get(e);
|
|
947
1584
|
}
|
|
948
1585
|
/**
|
|
949
1586
|
* Check if a tag has automatic ARIA role application enabled
|
|
950
1587
|
*/
|
|
951
1588
|
hasAutoARIA(e) {
|
|
952
|
-
const t =
|
|
1589
|
+
const t = K.get(e);
|
|
953
1590
|
return t ? t.applyARIA : !1;
|
|
954
1591
|
}
|
|
955
1592
|
/**
|
|
956
1593
|
* Get all tags that support automatic ARIA roles
|
|
957
1594
|
*/
|
|
958
1595
|
getAutoARIATags() {
|
|
959
|
-
return Array.from(
|
|
1596
|
+
return Array.from(K.entries()).filter(([, e]) => e.applyARIA).map(([e]) => e);
|
|
960
1597
|
}
|
|
961
1598
|
/**
|
|
962
1599
|
* Apply semantic attributes during DOM node creation
|
|
@@ -977,11 +1614,11 @@ const ae = class L {
|
|
|
977
1614
|
}
|
|
978
1615
|
}
|
|
979
1616
|
};
|
|
980
|
-
|
|
981
|
-
let
|
|
982
|
-
const
|
|
983
|
-
var
|
|
984
|
-
const
|
|
1617
|
+
At(xe, "instance");
|
|
1618
|
+
let Mt = xe;
|
|
1619
|
+
const xt = Mt.getInstance();
|
|
1620
|
+
var It = Object.defineProperty, Tt = (n, e, t) => e in n ? It(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ne = (n, e, t) => Tt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
1621
|
+
const $t = /* @__PURE__ */ new Set([
|
|
985
1622
|
"click",
|
|
986
1623
|
"dblclick",
|
|
987
1624
|
"mousedown",
|
|
@@ -1000,16 +1637,16 @@ const Je = /* @__PURE__ */ new Set([
|
|
|
1000
1637
|
"keydown",
|
|
1001
1638
|
"keyup",
|
|
1002
1639
|
"keypress"
|
|
1003
|
-
]),
|
|
1640
|
+
]), be = /* @__PURE__ */ new Set([
|
|
1004
1641
|
"scroll",
|
|
1005
1642
|
"wheel",
|
|
1006
1643
|
"touchstart",
|
|
1007
1644
|
"touchmove",
|
|
1008
1645
|
"touchend"
|
|
1009
1646
|
]);
|
|
1010
|
-
class
|
|
1647
|
+
class Nt {
|
|
1011
1648
|
constructor() {
|
|
1012
|
-
|
|
1649
|
+
ne(this, "containerListeners", /* @__PURE__ */ new WeakMap()), ne(this, "elementHandlers", /* @__PURE__ */ new WeakMap()), ne(this, "handlerCounts", /* @__PURE__ */ new WeakMap());
|
|
1013
1650
|
}
|
|
1014
1651
|
/**
|
|
1015
1652
|
* Register an event handler with delegation
|
|
@@ -1019,8 +1656,8 @@ class et {
|
|
|
1019
1656
|
i && i.has(s) && this.unregister(e, t, s), i || (i = /* @__PURE__ */ new Map(), this.elementHandlers.set(t, i)), i.set(s, { handler: r, element: t });
|
|
1020
1657
|
let o = this.handlerCounts.get(e);
|
|
1021
1658
|
o || (o = /* @__PURE__ */ new Map(), this.handlerCounts.set(e, o));
|
|
1022
|
-
const
|
|
1023
|
-
return o.set(s,
|
|
1659
|
+
const l = o.get(s) || 0;
|
|
1660
|
+
return o.set(s, l + 1), this.ensureRootListener(e, s), () => {
|
|
1024
1661
|
this.unregister(e, t, s);
|
|
1025
1662
|
};
|
|
1026
1663
|
}
|
|
@@ -1045,7 +1682,7 @@ class et {
|
|
|
1045
1682
|
return;
|
|
1046
1683
|
const r = (o) => {
|
|
1047
1684
|
this.handleDelegatedEvent(e, t, o);
|
|
1048
|
-
}, i =
|
|
1685
|
+
}, i = be.has(t) ? { passive: !0 } : { passive: !1 };
|
|
1049
1686
|
e.addEventListener(t, r, i), s.set(t, r);
|
|
1050
1687
|
}
|
|
1051
1688
|
/**
|
|
@@ -1067,12 +1704,12 @@ class et {
|
|
|
1067
1704
|
for (; i && i !== e; ) {
|
|
1068
1705
|
const o = this.elementHandlers.get(i);
|
|
1069
1706
|
if (o) {
|
|
1070
|
-
const
|
|
1071
|
-
if (
|
|
1707
|
+
const l = o.get(t);
|
|
1708
|
+
if (l) {
|
|
1072
1709
|
try {
|
|
1073
|
-
|
|
1074
|
-
} catch (
|
|
1075
|
-
console.error(`Delegated event handler error for ${t}:`,
|
|
1710
|
+
l.handler(s);
|
|
1711
|
+
} catch (a) {
|
|
1712
|
+
console.error(`Delegated event handler error for ${t}:`, a);
|
|
1076
1713
|
}
|
|
1077
1714
|
return;
|
|
1078
1715
|
}
|
|
@@ -1084,13 +1721,13 @@ class et {
|
|
|
1084
1721
|
* Check if event type should use delegation
|
|
1085
1722
|
*/
|
|
1086
1723
|
shouldDelegate(e) {
|
|
1087
|
-
return
|
|
1724
|
+
return $t.has(e);
|
|
1088
1725
|
}
|
|
1089
1726
|
/**
|
|
1090
1727
|
* Check if event type should use passive listeners
|
|
1091
1728
|
*/
|
|
1092
1729
|
shouldBePassive(e) {
|
|
1093
|
-
return
|
|
1730
|
+
return be.has(e);
|
|
1094
1731
|
}
|
|
1095
1732
|
/**
|
|
1096
1733
|
* Get metrics for debugging
|
|
@@ -1119,11 +1756,11 @@ class et {
|
|
|
1119
1756
|
}), this.containerListeners.delete(e)), this.handlerCounts.delete(e);
|
|
1120
1757
|
}
|
|
1121
1758
|
}
|
|
1122
|
-
const
|
|
1123
|
-
var
|
|
1124
|
-
class
|
|
1759
|
+
const oe = new Nt();
|
|
1760
|
+
var Rt = Object.defineProperty, Ot = (n, e, t) => e in n ? Rt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, j = (n, e, t) => Ot(n, typeof e != "symbol" ? e + "" : e, t);
|
|
1761
|
+
class Ie {
|
|
1125
1762
|
constructor() {
|
|
1126
|
-
|
|
1763
|
+
j(this, "nodeMap", /* @__PURE__ */ new WeakMap()), j(this, "cleanupMap", /* @__PURE__ */ new WeakMap()), j(this, "renderedNodes", /* @__PURE__ */ new Set()), j(this, "elementToContainer", /* @__PURE__ */ new WeakMap()), j(this, "metrics", {
|
|
1127
1764
|
created: 0,
|
|
1128
1765
|
adopted: 0,
|
|
1129
1766
|
removed: 0,
|
|
@@ -1211,69 +1848,69 @@ class le {
|
|
|
1211
1848
|
return;
|
|
1212
1849
|
this.setElementProp(e, o, void 0);
|
|
1213
1850
|
}
|
|
1214
|
-
}), Object.entries(r).forEach(([o,
|
|
1215
|
-
o === "key" || o === "children" || i && i[o] ===
|
|
1851
|
+
}), Object.entries(r).forEach(([o, l]) => {
|
|
1852
|
+
o === "key" || o === "children" || i && i[o] === l || this.applyProp(e, o, l, s);
|
|
1216
1853
|
}), t.__appliedProps = { ...r }, "componentMetadata" in t && t.componentMetadata) {
|
|
1217
1854
|
const o = t.componentMetadata;
|
|
1218
1855
|
if (o.overriddenTo && o.originalType && t.tag)
|
|
1219
1856
|
try {
|
|
1220
|
-
|
|
1857
|
+
xt.processElementNode(
|
|
1221
1858
|
e,
|
|
1222
1859
|
t.tag,
|
|
1223
1860
|
o,
|
|
1224
1861
|
r?.aria || void 0
|
|
1225
1862
|
);
|
|
1226
|
-
} catch (
|
|
1227
|
-
console.warn("[tachUI] Could not process semantic attributes:",
|
|
1863
|
+
} catch (l) {
|
|
1864
|
+
console.warn("[tachUI] Could not process semantic attributes:", l);
|
|
1228
1865
|
}
|
|
1229
1866
|
}
|
|
1230
1867
|
}
|
|
1231
1868
|
updateChildren(e, t) {
|
|
1232
1869
|
const s = t.__renderedChildren || [], r = t.children || [], i = this.elementToContainer.get(e), o = typeof process < "u" && process.env?.TACHUI_DEBUG_PHASE1B === "1";
|
|
1233
|
-
if (s.length === r.length && s.length > 0 && s.every((
|
|
1234
|
-
r.forEach((
|
|
1235
|
-
this.updateExistingNode(
|
|
1870
|
+
if (s.length === r.length && s.length > 0 && s.every((c, u) => c === r[u])) {
|
|
1871
|
+
r.forEach((c) => {
|
|
1872
|
+
this.updateExistingNode(c);
|
|
1236
1873
|
}), t.__renderedChildren = r;
|
|
1237
1874
|
return;
|
|
1238
1875
|
}
|
|
1239
1876
|
if (s.length === 0) {
|
|
1240
|
-
r.forEach((
|
|
1241
|
-
if (!
|
|
1242
|
-
const
|
|
1243
|
-
this.appendNode(e,
|
|
1877
|
+
r.forEach((c) => {
|
|
1878
|
+
if (!c || c.type == null) return;
|
|
1879
|
+
const u = this.renderSingle(c, i);
|
|
1880
|
+
this.appendNode(e, u);
|
|
1244
1881
|
}), t.__renderedChildren = r;
|
|
1245
1882
|
return;
|
|
1246
1883
|
}
|
|
1247
|
-
const
|
|
1248
|
-
s.forEach((
|
|
1249
|
-
|
|
1884
|
+
const l = /* @__PURE__ */ new Map(), a = [];
|
|
1885
|
+
s.forEach((c) => {
|
|
1886
|
+
c.key != null ? l.set(c.key, c) : a.push(c);
|
|
1250
1887
|
});
|
|
1251
|
-
const
|
|
1252
|
-
if (r.forEach((
|
|
1888
|
+
const h = Array.from({ length: r.length });
|
|
1889
|
+
if (r.forEach((c, u) => {
|
|
1253
1890
|
let f;
|
|
1254
|
-
|
|
1255
|
-
const p = this.renderSingle(
|
|
1256
|
-
|
|
1891
|
+
c.key != null ? (f = l.get(c.key), f && l.delete(c.key)) : a.length > 0 && (f = a.shift()), f && this.adoptNode(f, c);
|
|
1892
|
+
const p = this.renderSingle(c, i);
|
|
1893
|
+
h[u] = p;
|
|
1257
1894
|
}), o && t.tag) {
|
|
1258
|
-
const
|
|
1895
|
+
const c = r.map((p) => p.key ?? null), u = s.map((p) => p.key ?? null), f = h.map(
|
|
1259
1896
|
(p) => p && "getAttribute" in p ? p.getAttribute("data-id") : null
|
|
1260
1897
|
);
|
|
1261
1898
|
console.log("[diff] state", {
|
|
1262
1899
|
parent: t.tag,
|
|
1263
|
-
prev:
|
|
1264
|
-
next:
|
|
1900
|
+
prev: u,
|
|
1901
|
+
next: c,
|
|
1265
1902
|
dom: f
|
|
1266
1903
|
});
|
|
1267
1904
|
}
|
|
1268
|
-
if (
|
|
1269
|
-
this.removeNode(
|
|
1270
|
-
}),
|
|
1271
|
-
this.removeNode(
|
|
1905
|
+
if (l.forEach((c) => {
|
|
1906
|
+
this.removeNode(c);
|
|
1907
|
+
}), a.forEach((c) => {
|
|
1908
|
+
this.removeNode(c);
|
|
1272
1909
|
}), typeof e.insertBefore == "function" && typeof e.appendChild == "function") {
|
|
1273
|
-
let
|
|
1274
|
-
for (let
|
|
1275
|
-
const f =
|
|
1276
|
-
f && (this.insertNode(e, f,
|
|
1910
|
+
let c = null;
|
|
1911
|
+
for (let u = h.length - 1; u >= 0; u--) {
|
|
1912
|
+
const f = h[u];
|
|
1913
|
+
f && (this.insertNode(e, f, c), c = f);
|
|
1277
1914
|
}
|
|
1278
1915
|
}
|
|
1279
1916
|
t.__renderedChildren = r;
|
|
@@ -1296,7 +1933,7 @@ class le {
|
|
|
1296
1933
|
if (e.element && e.element instanceof Text) {
|
|
1297
1934
|
const t = e.element;
|
|
1298
1935
|
if (t.textContent !== e.text && (t.textContent = e.text || "", this.recordTextUpdate()), e.reactiveContent && !e.dispose) {
|
|
1299
|
-
const s = e.reactiveContent, r =
|
|
1936
|
+
const s = e.reactiveContent, r = T(() => {
|
|
1300
1937
|
try {
|
|
1301
1938
|
const i = s();
|
|
1302
1939
|
e.text = String(i);
|
|
@@ -1322,7 +1959,7 @@ class le {
|
|
|
1322
1959
|
createTextNode(e) {
|
|
1323
1960
|
const t = document.createTextNode(e.text || "");
|
|
1324
1961
|
if (this.metrics.created++, this.recordTextUpdate(), e.reactiveContent) {
|
|
1325
|
-
const s = e.reactiveContent, r =
|
|
1962
|
+
const s = e.reactiveContent, r = T(() => {
|
|
1326
1963
|
try {
|
|
1327
1964
|
const i = s();
|
|
1328
1965
|
e.text = String(i);
|
|
@@ -1370,8 +2007,8 @@ class le {
|
|
|
1370
2007
|
this.applyEventListener(e, t, s, r);
|
|
1371
2008
|
return;
|
|
1372
2009
|
}
|
|
1373
|
-
if (
|
|
1374
|
-
const i =
|
|
2010
|
+
if (F(s) || B(s)) {
|
|
2011
|
+
const i = T(() => {
|
|
1375
2012
|
const o = s();
|
|
1376
2013
|
this.setElementProp(e, t, o);
|
|
1377
2014
|
});
|
|
@@ -1406,8 +2043,8 @@ class le {
|
|
|
1406
2043
|
* Apply className with reactive updates
|
|
1407
2044
|
*/
|
|
1408
2045
|
applyClassName(e, t) {
|
|
1409
|
-
if (
|
|
1410
|
-
const s =
|
|
2046
|
+
if (F(t) || B(t)) {
|
|
2047
|
+
const s = T(() => {
|
|
1411
2048
|
const r = t(), i = this.normalizeClassName(r);
|
|
1412
2049
|
e.className !== i && (e.className = i, this.recordAttributeWrite());
|
|
1413
2050
|
});
|
|
@@ -1430,8 +2067,8 @@ class le {
|
|
|
1430
2067
|
*/
|
|
1431
2068
|
applyStyle(e, t) {
|
|
1432
2069
|
const s = e;
|
|
1433
|
-
if (
|
|
1434
|
-
const r =
|
|
2070
|
+
if (F(t) || B(t)) {
|
|
2071
|
+
const r = T(() => {
|
|
1435
2072
|
const i = t();
|
|
1436
2073
|
this.setElementStyles(s, i);
|
|
1437
2074
|
});
|
|
@@ -1454,26 +2091,26 @@ class le {
|
|
|
1454
2091
|
Object.keys(s).forEach((r) => {
|
|
1455
2092
|
r in t || (e.style.removeProperty(r.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`)), this.recordAttributeRemoval());
|
|
1456
2093
|
}), Object.entries(t).forEach(([r, i]) => {
|
|
1457
|
-
if (
|
|
1458
|
-
const o =
|
|
1459
|
-
const
|
|
1460
|
-
if (
|
|
1461
|
-
e.style.removeProperty(
|
|
2094
|
+
if (F(i) || B(i)) {
|
|
2095
|
+
const o = T(() => {
|
|
2096
|
+
const l = i(), a = r.replace(/[A-Z]/g, (h) => `-${h.toLowerCase()}`);
|
|
2097
|
+
if (l == null)
|
|
2098
|
+
e.style.removeProperty(a), this.recordAttributeRemoval();
|
|
1462
2099
|
else {
|
|
1463
|
-
const
|
|
1464
|
-
e.style.getPropertyValue(
|
|
2100
|
+
const h = String(l);
|
|
2101
|
+
e.style.getPropertyValue(a) !== h && (e.style.setProperty(a, h), this.recordAttributeWrite());
|
|
1465
2102
|
}
|
|
1466
2103
|
});
|
|
1467
2104
|
this.addCleanup(e, () => {
|
|
1468
2105
|
o.dispose();
|
|
1469
2106
|
});
|
|
1470
2107
|
} else {
|
|
1471
|
-
const o = r.replace(/[A-Z]/g, (
|
|
2108
|
+
const o = r.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`);
|
|
1472
2109
|
if (i == null)
|
|
1473
2110
|
e.style.getPropertyValue(o) && (e.style.removeProperty(o), this.recordAttributeRemoval());
|
|
1474
2111
|
else {
|
|
1475
|
-
const
|
|
1476
|
-
e.style.getPropertyValue(o) !==
|
|
2112
|
+
const l = String(i);
|
|
2113
|
+
e.style.getPropertyValue(o) !== l && (e.style.setProperty(o, l), this.recordAttributeWrite());
|
|
1477
2114
|
}
|
|
1478
2115
|
}
|
|
1479
2116
|
}), e.__appliedStyles = { ...t };
|
|
@@ -1486,25 +2123,25 @@ class le {
|
|
|
1486
2123
|
let i = t.slice(2).toLowerCase();
|
|
1487
2124
|
i === "focus" ? i = "focusin" : i === "blur" && (i = "focusout");
|
|
1488
2125
|
const o = r || this.elementToContainer.get(e);
|
|
1489
|
-
if (o &&
|
|
1490
|
-
const
|
|
2126
|
+
if (o && oe.shouldDelegate(i)) {
|
|
2127
|
+
const h = oe.register(
|
|
1491
2128
|
o,
|
|
1492
2129
|
e,
|
|
1493
2130
|
i,
|
|
1494
2131
|
s
|
|
1495
2132
|
);
|
|
1496
|
-
this.addCleanup(e,
|
|
2133
|
+
this.addCleanup(e, h);
|
|
1497
2134
|
return;
|
|
1498
2135
|
}
|
|
1499
|
-
const
|
|
2136
|
+
const l = (h) => {
|
|
1500
2137
|
try {
|
|
1501
|
-
s(
|
|
1502
|
-
} catch (
|
|
1503
|
-
console.error(`Event handler error for ${t}:`,
|
|
2138
|
+
s(h);
|
|
2139
|
+
} catch (c) {
|
|
2140
|
+
console.error(`Event handler error for ${t}:`, c);
|
|
1504
2141
|
}
|
|
1505
|
-
},
|
|
1506
|
-
e.addEventListener(i,
|
|
1507
|
-
e.removeEventListener(i,
|
|
2142
|
+
}, a = oe.shouldBePassive(i) ? { passive: !0 } : void 0;
|
|
2143
|
+
e.addEventListener(i, l, a), this.addCleanup(e, () => {
|
|
2144
|
+
e.removeEventListener(i, l, a);
|
|
1508
2145
|
});
|
|
1509
2146
|
}
|
|
1510
2147
|
/**
|
|
@@ -1552,7 +2189,7 @@ class le {
|
|
|
1552
2189
|
*/
|
|
1553
2190
|
createReactiveText(e) {
|
|
1554
2191
|
const t = document.createTextNode("");
|
|
1555
|
-
return
|
|
2192
|
+
return T(() => {
|
|
1556
2193
|
t.textContent = e();
|
|
1557
2194
|
}), t;
|
|
1558
2195
|
}
|
|
@@ -1561,7 +2198,7 @@ class le {
|
|
|
1561
2198
|
*/
|
|
1562
2199
|
createReactiveElement(e, t, s) {
|
|
1563
2200
|
const r = document.createElement(e);
|
|
1564
|
-
return
|
|
2201
|
+
return T(() => {
|
|
1565
2202
|
const i = t();
|
|
1566
2203
|
this.applyProps(r, i);
|
|
1567
2204
|
}), s && s.forEach((i) => {
|
|
@@ -1577,7 +2214,7 @@ class le {
|
|
|
1577
2214
|
t.length > 0 && this.recordModifierApplications(t.length);
|
|
1578
2215
|
const r = s.componentInstance || s.componentMetadata && s.componentMetadata.componentInstance || s._originalComponent || // Use original component if available
|
|
1579
2216
|
s;
|
|
1580
|
-
|
|
2217
|
+
Me(
|
|
1581
2218
|
s,
|
|
1582
2219
|
t,
|
|
1583
2220
|
{
|
|
@@ -1666,11 +2303,497 @@ class le {
|
|
|
1666
2303
|
this.metrics.modifierApplications += e;
|
|
1667
2304
|
}
|
|
1668
2305
|
}
|
|
1669
|
-
new
|
|
1670
|
-
|
|
1671
|
-
|
|
2306
|
+
new Ie();
|
|
2307
|
+
function Pt(n, e, ...t) {
|
|
2308
|
+
const s = t.flat().filter((i) => i != null).map((i) => typeof i == "string" || typeof i == "number" ? { type: "text", text: String(i) } : i), r = {
|
|
2309
|
+
type: "element",
|
|
2310
|
+
tag: n,
|
|
2311
|
+
props: e || {},
|
|
2312
|
+
children: s,
|
|
2313
|
+
key: e?.key ?? void 0
|
|
2314
|
+
};
|
|
2315
|
+
return e && "componentMetadata" in e && (r.componentMetadata = e.componentMetadata), r;
|
|
2316
|
+
}
|
|
2317
|
+
var kt = Object.defineProperty, Lt = (n, e, t) => e in n ? kt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, P = (n, e, t) => Lt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
2318
|
+
let Y = class ee {
|
|
2319
|
+
// Required by ModifiableComponent interface
|
|
2320
|
+
constructor(e, t, s = !0) {
|
|
2321
|
+
this.metadata = t, P(this, "type", "component"), P(this, "id"), P(this, "mounted", !1), P(this, "cleanup", []), P(this, "props", {}), P(this, "segments"), P(this, "modifiers", []), this.id = `concat-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.segments = e;
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Render the concatenated component to DOM nodes (Enhanced - Phase 4.2)
|
|
2325
|
+
*/
|
|
2326
|
+
render() {
|
|
2327
|
+
const e = this.determineContainerClass(), t = this.buildAccessibilityLabel(), s = this.buildAccessibilityAttributes(), r = this.modifiers && this.modifiers.some((o) => o.type === "asHTML");
|
|
2328
|
+
let i;
|
|
2329
|
+
return r ? i = this.renderSegmentsWithAsHTML() : i = this.segments.map((o) => o.render()).flat(), [Pt("span", {
|
|
2330
|
+
class: `tachui-concatenated ${e}`,
|
|
2331
|
+
...s,
|
|
2332
|
+
"aria-label": t || void 0,
|
|
2333
|
+
// Enhanced live region support for dynamic content
|
|
2334
|
+
...this.hasInteractiveContent() && {
|
|
2335
|
+
"aria-live": "polite",
|
|
2336
|
+
"aria-atomic": "true"
|
|
2337
|
+
},
|
|
2338
|
+
// Add debug information in development
|
|
2339
|
+
...process.env.NODE_ENV === "development" && {
|
|
2340
|
+
"data-concatenated-segments": this.segments.length,
|
|
2341
|
+
"data-semantic-structure": this.metadata.semanticStructure,
|
|
2342
|
+
"data-accessibility-role": this.metadata.accessibilityRole
|
|
2343
|
+
}
|
|
2344
|
+
}, ...i)];
|
|
2345
|
+
}
|
|
2346
|
+
/**
|
|
2347
|
+
* Build comprehensive accessibility attributes
|
|
2348
|
+
*/
|
|
2349
|
+
buildAccessibilityAttributes() {
|
|
2350
|
+
const e = {};
|
|
2351
|
+
switch (this.metadata.accessibilityRole) {
|
|
2352
|
+
case "text":
|
|
2353
|
+
break;
|
|
2354
|
+
case "group":
|
|
2355
|
+
e.role = "group", e["aria-describedby"] = this.generateGroupDescription();
|
|
2356
|
+
break;
|
|
2357
|
+
case "composite":
|
|
2358
|
+
e.role = "group", e["aria-roledescription"] = "interactive content group";
|
|
2359
|
+
break;
|
|
2360
|
+
}
|
|
2361
|
+
return this.metadata.semanticStructure === "mixed" && this.segments.length > 2 && (e["aria-flowto"] = this.generateFlowTargets()), this.hasInteractiveContent() && (e.tabindex = "0", e["aria-description"] = "Contains interactive elements. Use Tab to navigate."), e;
|
|
2362
|
+
}
|
|
2363
|
+
/**
|
|
2364
|
+
* Generate description for grouped content
|
|
2365
|
+
*/
|
|
2366
|
+
generateGroupDescription() {
|
|
2367
|
+
const e = this.getUniqueComponentTypes();
|
|
2368
|
+
return e.length === 1 ? `Group of ${this.segments.length} ${e[0]} elements` : `Group containing ${e.join(", ")} elements`;
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* Generate flow targets for reading order
|
|
2372
|
+
*/
|
|
2373
|
+
generateFlowTargets() {
|
|
2374
|
+
return "";
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Check if concatenated content contains interactive elements
|
|
2378
|
+
*/
|
|
2379
|
+
hasInteractiveContent() {
|
|
2380
|
+
return this.segments.some((e) => {
|
|
2381
|
+
const t = e.component.constructor.name;
|
|
2382
|
+
return t === "EnhancedButton" || t === "EnhancedLinkComponent";
|
|
2383
|
+
});
|
|
2384
|
+
}
|
|
2385
|
+
/**
|
|
2386
|
+
* Get unique component types in this concatenation
|
|
2387
|
+
*/
|
|
2388
|
+
getUniqueComponentTypes() {
|
|
2389
|
+
const e = new Set(this.segments.map((t) => {
|
|
2390
|
+
switch (t.component.constructor.name) {
|
|
2391
|
+
case "EnhancedText":
|
|
2392
|
+
return "text";
|
|
2393
|
+
case "EnhancedImage":
|
|
2394
|
+
return "image";
|
|
2395
|
+
case "EnhancedButton":
|
|
2396
|
+
return "button";
|
|
2397
|
+
case "EnhancedLinkComponent":
|
|
2398
|
+
return "link";
|
|
2399
|
+
default:
|
|
2400
|
+
return "component";
|
|
2401
|
+
}
|
|
2402
|
+
}));
|
|
2403
|
+
return Array.from(e);
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Concatenate this component with another concatenatable component
|
|
2407
|
+
*/
|
|
2408
|
+
concat(e) {
|
|
2409
|
+
let t, s;
|
|
2410
|
+
return e instanceof ee ? (t = [...this.segments, ...e.segments], s = this.mergeMetadata(this.metadata, e.metadata, t.length)) : (t = [...this.segments, e.toSegment()], s = this.mergeMetadata(
|
|
2411
|
+
this.metadata,
|
|
2412
|
+
{
|
|
2413
|
+
totalSegments: 1,
|
|
2414
|
+
accessibilityRole: this.determineComponentAccessibilityRole(e),
|
|
2415
|
+
semanticStructure: this.determineComponentSemanticStructure(e)
|
|
2416
|
+
},
|
|
2417
|
+
t.length
|
|
2418
|
+
)), new ee(t, s);
|
|
2419
|
+
}
|
|
2420
|
+
/**
|
|
2421
|
+
* Convert this concatenated component to a segment (for further concatenation)
|
|
2422
|
+
*/
|
|
2423
|
+
toSegment() {
|
|
2424
|
+
return {
|
|
2425
|
+
id: this.id,
|
|
2426
|
+
component: this,
|
|
2427
|
+
// Cast to satisfy interface requirements
|
|
2428
|
+
modifiers: [],
|
|
2429
|
+
// Concatenated components don't have their own modifiers
|
|
2430
|
+
render: () => this.render()[0]
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2433
|
+
/**
|
|
2434
|
+
* Check if this component supports concatenation
|
|
2435
|
+
*/
|
|
2436
|
+
isConcatenatable() {
|
|
2437
|
+
return !0;
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Determine the appropriate CSS class for the container
|
|
2441
|
+
*/
|
|
2442
|
+
determineContainerClass() {
|
|
2443
|
+
const e = this.segments.map((o) => o.component.constructor.name), t = e.some((o) => o === "EnhancedImage"), s = e.some((o) => o === "EnhancedText"), r = e.some((o) => o === "EnhancedButton"), i = e.some((o) => o === "EnhancedLink");
|
|
2444
|
+
return t && s && (r || i) ? "mixed-content" : t && s ? "image-text-composition" : t && !s ? "image-composition" : s && !t ? "text-composition" : "generic-composition";
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
* Build comprehensive accessibility label for screen readers (Enhanced - Phase 4.2)
|
|
2448
|
+
*/
|
|
2449
|
+
buildAccessibilityLabel() {
|
|
2450
|
+
const e = this.segments.map((t) => this.extractAccessibilityText(t)).filter(Boolean);
|
|
2451
|
+
return e.length === 0 ? "" : this.joinAccessibilityLabels(e);
|
|
2452
|
+
}
|
|
2453
|
+
/**
|
|
2454
|
+
* Intelligently join accessibility labels based on content and structure
|
|
2455
|
+
*/
|
|
2456
|
+
joinAccessibilityLabels(e) {
|
|
2457
|
+
if (e.length === 1) return e[0];
|
|
2458
|
+
switch (this.metadata.semanticStructure) {
|
|
2459
|
+
case "inline":
|
|
2460
|
+
return e.join(" ");
|
|
2461
|
+
case "block":
|
|
2462
|
+
return e.join(". ");
|
|
2463
|
+
case "mixed":
|
|
2464
|
+
return this.smartJoinLabels(e);
|
|
2465
|
+
default:
|
|
2466
|
+
return e.join(" ");
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* Context-aware label joining for mixed content
|
|
2471
|
+
*/
|
|
2472
|
+
smartJoinLabels(e) {
|
|
2473
|
+
const t = [];
|
|
2474
|
+
for (let s = 0; s < e.length; s++) {
|
|
2475
|
+
const r = e[s], i = e[s + 1];
|
|
2476
|
+
t.push(r), i && (this.needsExplicitSeparator(r, i) ? t.push(". ") : t.push(" "));
|
|
2477
|
+
}
|
|
2478
|
+
return t.join("");
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Determine if two accessibility labels need explicit separation
|
|
2482
|
+
*/
|
|
2483
|
+
needsExplicitSeparator(e, t) {
|
|
2484
|
+
const s = /[.!?:;]$/.test(e.trim()), r = /^[A-Z]/.test(t.trim());
|
|
2485
|
+
return !s && r;
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Extract accessibility text from a component segment
|
|
2489
|
+
*/
|
|
2490
|
+
extractAccessibilityText(e) {
|
|
2491
|
+
const t = e.component;
|
|
2492
|
+
switch (t.constructor.name) {
|
|
2493
|
+
case "EnhancedText":
|
|
2494
|
+
return t.content || t.title || "";
|
|
2495
|
+
case "EnhancedImage":
|
|
2496
|
+
return t.alt || t.accessibilityLabel || "Image";
|
|
2497
|
+
case "EnhancedButton":
|
|
2498
|
+
return t.title || t.accessibilityLabel || "Button";
|
|
2499
|
+
case "EnhancedLink":
|
|
2500
|
+
return t.title || t.accessibilityLabel || "Link";
|
|
2501
|
+
case "ConcatenatedComponent":
|
|
2502
|
+
return t.buildAccessibilityLabel();
|
|
2503
|
+
default:
|
|
2504
|
+
return t.accessibilityLabel || "";
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
/**
|
|
2508
|
+
* Merge metadata from two concatenation operations
|
|
2509
|
+
*/
|
|
2510
|
+
mergeMetadata(e, t, s) {
|
|
2511
|
+
return {
|
|
2512
|
+
totalSegments: s,
|
|
2513
|
+
accessibilityRole: this.mergeAccessibilityRoles(
|
|
2514
|
+
e.accessibilityRole,
|
|
2515
|
+
t.accessibilityRole
|
|
2516
|
+
),
|
|
2517
|
+
semanticStructure: this.mergeSemanticStructures(
|
|
2518
|
+
e.semanticStructure,
|
|
2519
|
+
t.semanticStructure
|
|
2520
|
+
)
|
|
2521
|
+
};
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* Merge accessibility roles from two components
|
|
2525
|
+
*/
|
|
2526
|
+
mergeAccessibilityRoles(e, t) {
|
|
2527
|
+
return e === "text" && t === "text" ? "text" : e === "composite" || t === "composite" ? "composite" : "group";
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Merge semantic structures from two components
|
|
2531
|
+
*/
|
|
2532
|
+
mergeSemanticStructures(e, t) {
|
|
2533
|
+
return e === "inline" && t === "inline" ? "inline" : e === "block" && t === "block" ? "block" : "mixed";
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* Determine accessibility role for a single component
|
|
2537
|
+
*/
|
|
2538
|
+
determineComponentAccessibilityRole(e) {
|
|
2539
|
+
switch (e.constructor.name) {
|
|
2540
|
+
case "EnhancedText":
|
|
2541
|
+
return "text";
|
|
2542
|
+
case "EnhancedImage":
|
|
2543
|
+
return "group";
|
|
2544
|
+
case "EnhancedButton":
|
|
2545
|
+
case "EnhancedLink":
|
|
2546
|
+
return "group";
|
|
2547
|
+
default:
|
|
2548
|
+
return "composite";
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Determine semantic structure for a single component
|
|
2553
|
+
*/
|
|
2554
|
+
determineComponentSemanticStructure(e) {
|
|
2555
|
+
switch (e.constructor.name) {
|
|
2556
|
+
case "EnhancedText":
|
|
2557
|
+
case "EnhancedImage":
|
|
2558
|
+
return "inline";
|
|
2559
|
+
case "EnhancedButton":
|
|
2560
|
+
case "EnhancedLink":
|
|
2561
|
+
return "inline";
|
|
2562
|
+
// Buttons and links are typically inline in concatenation
|
|
2563
|
+
default:
|
|
2564
|
+
return "mixed";
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Special rendering method for segments with asHTML modifiers
|
|
2569
|
+
*/
|
|
2570
|
+
renderSegmentsWithAsHTML() {
|
|
2571
|
+
const e = this.modifiers?.filter((s) => s.type === "asHTML") || [], t = [];
|
|
2572
|
+
for (const s of this.segments) {
|
|
2573
|
+
const r = s.render(), i = Array.isArray(r) ? r : [r];
|
|
2574
|
+
if (this.isTextSegment(s) && i.length > 0) {
|
|
2575
|
+
const o = this.applyAsHTMLToSegment(i[0], e, s);
|
|
2576
|
+
t.push(o);
|
|
2577
|
+
} else
|
|
2578
|
+
t.push(...i);
|
|
2579
|
+
}
|
|
2580
|
+
return t;
|
|
2581
|
+
}
|
|
2582
|
+
/**
|
|
2583
|
+
* Check if a segment represents a Text component
|
|
2584
|
+
*/
|
|
2585
|
+
isTextSegment(e) {
|
|
2586
|
+
const t = e.component;
|
|
2587
|
+
return t ? t.constructor?.name === "TextComponent" || t.constructor?.name === "EnhancedText" || t.__tachui_component_type === "Text" || t.componentMetadata?.originalType === "Text" : !1;
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* Apply asHTML modifiers to a segment with proper component context
|
|
2591
|
+
*/
|
|
2592
|
+
applyAsHTMLToSegment(e, t, s) {
|
|
2593
|
+
const r = {
|
|
2594
|
+
element: void 0,
|
|
2595
|
+
// Will be set when the node is rendered to DOM
|
|
2596
|
+
componentId: s.id,
|
|
2597
|
+
phase: "creation",
|
|
2598
|
+
componentInstance: s.component
|
|
2599
|
+
// Pass the original component
|
|
2600
|
+
};
|
|
2601
|
+
return Me(e, t, r, { batch: !0 });
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Generate comprehensive accessibility tree for this concatenated component
|
|
2605
|
+
*/
|
|
2606
|
+
generateAccessibilityTree() {
|
|
2607
|
+
return {
|
|
2608
|
+
role: this.metadata.accessibilityRole,
|
|
2609
|
+
label: this.buildAccessibilityLabel(),
|
|
2610
|
+
children: this.segments.map((e) => this.segmentToAccessibilityNode(e))
|
|
2611
|
+
};
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Convert a component segment to an accessibility node
|
|
2615
|
+
*/
|
|
2616
|
+
segmentToAccessibilityNode(e) {
|
|
2617
|
+
const t = e.component;
|
|
2618
|
+
return {
|
|
2619
|
+
role: this.determineComponentAccessibilityRole(t),
|
|
2620
|
+
label: this.extractAccessibilityText(e),
|
|
2621
|
+
children: t instanceof ee ? t.generateAccessibilityTree().children : void 0
|
|
2622
|
+
};
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
const Dt = {
|
|
2626
|
+
proxyModifiers: !0
|
|
2627
|
+
};
|
|
2628
|
+
let zt = { ...Dt };
|
|
2629
|
+
function Te() {
|
|
2630
|
+
return zt.proxyModifiers === !0;
|
|
2631
|
+
}
|
|
2632
|
+
let Se = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap();
|
|
2633
|
+
function $(n) {
|
|
2634
|
+
if (Object.prototype.hasOwnProperty.call(n, "modifiers") && Object.prototype.hasOwnProperty.call(n, "modifierBuilder"))
|
|
2635
|
+
return n;
|
|
2636
|
+
if (!n._modifiableComponent) {
|
|
2637
|
+
const e = te(n);
|
|
2638
|
+
Object.prototype.hasOwnProperty.call(n, "modifier") || Object.defineProperty(n, "modifier", {
|
|
2639
|
+
configurable: !0,
|
|
2640
|
+
enumerable: !1,
|
|
2641
|
+
get() {
|
|
2642
|
+
return e.modifierBuilder;
|
|
2643
|
+
},
|
|
2644
|
+
set(t) {
|
|
2645
|
+
Object.defineProperty(n, "modifier", {
|
|
2646
|
+
configurable: !0,
|
|
2647
|
+
enumerable: !1,
|
|
2648
|
+
writable: !0,
|
|
2649
|
+
value: t
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2652
|
+
}), n._modifiableComponent = e;
|
|
2653
|
+
}
|
|
2654
|
+
return n._modifiableComponent;
|
|
2655
|
+
}
|
|
2656
|
+
function he(n) {
|
|
2657
|
+
if (!Te())
|
|
2658
|
+
return n;
|
|
2659
|
+
const e = Se.get(n);
|
|
2660
|
+
if (e)
|
|
2661
|
+
return e;
|
|
2662
|
+
const t = /* @__PURE__ */ new Map();
|
|
2663
|
+
_t.set(n, t);
|
|
2664
|
+
const s = /* @__PURE__ */ new Map();
|
|
2665
|
+
Ht.set(n, s);
|
|
2666
|
+
const r = /* @__PURE__ */ new Map();
|
|
2667
|
+
Vt.set(n, r);
|
|
2668
|
+
const i = {
|
|
2669
|
+
get(l, a, h) {
|
|
2670
|
+
if (a === Symbol.toStringTag)
|
|
2671
|
+
return Reflect.get(l, a, h);
|
|
2672
|
+
if (a === "render") {
|
|
2673
|
+
if (r.has(a))
|
|
2674
|
+
return r.get(a);
|
|
2675
|
+
const c = $(l);
|
|
2676
|
+
if (typeof c.render == "function") {
|
|
2677
|
+
const u = c.render.bind(c);
|
|
2678
|
+
return r.set(a, u), u;
|
|
2679
|
+
}
|
|
2680
|
+
return Reflect.get(l, a, h);
|
|
2681
|
+
}
|
|
2682
|
+
if (a === "build") {
|
|
2683
|
+
const c = $(l), u = c.modifierBuilder || c.modifier;
|
|
2684
|
+
if (u && typeof u.build == "function") {
|
|
2685
|
+
const f = u.build.bind(u);
|
|
2686
|
+
return (...p) => {
|
|
2687
|
+
const v = f(...p);
|
|
2688
|
+
return v && typeof v == "object" && !Array.isArray(v) ? he(
|
|
2689
|
+
v
|
|
2690
|
+
) : v;
|
|
2691
|
+
};
|
|
2692
|
+
}
|
|
2693
|
+
return;
|
|
2694
|
+
}
|
|
2695
|
+
if (a === "modifiers" || a === "modifier" || a === "modifierBuilder") {
|
|
2696
|
+
if (a === "modifier") {
|
|
2697
|
+
const u = Object.getOwnPropertyDescriptor(
|
|
2698
|
+
l,
|
|
2699
|
+
"modifier"
|
|
2700
|
+
);
|
|
2701
|
+
if (u && "value" in u)
|
|
2702
|
+
return u.value;
|
|
2703
|
+
}
|
|
2704
|
+
const c = $(l);
|
|
2705
|
+
return a === "modifiers" ? c.modifiers : c.modifierBuilder;
|
|
2706
|
+
}
|
|
2707
|
+
if (typeof a == "string") {
|
|
2708
|
+
let c;
|
|
2709
|
+
if (t.has(a) && (c = V.get(a), c)) {
|
|
2710
|
+
const p = s.get(a);
|
|
2711
|
+
p !== void 0 && p !== c && (t.delete(a), s.delete(a));
|
|
2712
|
+
}
|
|
2713
|
+
if (Reflect.has(l, a)) {
|
|
2714
|
+
const p = Reflect.get(l, a, l);
|
|
2715
|
+
if (typeof p != "function")
|
|
2716
|
+
return p;
|
|
2717
|
+
}
|
|
2718
|
+
const u = $(l), f = u.modifierBuilder || u.modifier;
|
|
2719
|
+
if (f) {
|
|
2720
|
+
const p = f[a];
|
|
2721
|
+
if (typeof p == "function") {
|
|
2722
|
+
if (!t.has(a)) {
|
|
2723
|
+
const v = (...k) => {
|
|
2724
|
+
const C = $(l), E = C.modifierBuilder || C.modifier, pe = E?.[a];
|
|
2725
|
+
if (typeof pe != "function")
|
|
2726
|
+
throw new Error(
|
|
2727
|
+
`Modifier '${String(a)}' is not callable`
|
|
2728
|
+
);
|
|
2729
|
+
const se = pe.apply(E, k);
|
|
2730
|
+
return se && se !== E ? se : o;
|
|
2731
|
+
};
|
|
2732
|
+
t.set(a, v), s.set(
|
|
2733
|
+
a,
|
|
2734
|
+
c ?? V.get(a)
|
|
2735
|
+
);
|
|
2736
|
+
}
|
|
2737
|
+
return t.get(a);
|
|
2738
|
+
}
|
|
2739
|
+
if (p !== void 0)
|
|
2740
|
+
return p;
|
|
2741
|
+
}
|
|
2742
|
+
if (V.has(a)) {
|
|
2743
|
+
if (!t.has(a)) {
|
|
2744
|
+
const p = (...v) => {
|
|
2745
|
+
const k = $(l), C = k.modifierBuilder || k.modifier, E = C?.[a];
|
|
2746
|
+
if (typeof E != "function")
|
|
2747
|
+
throw new Error(`Modifier '${String(a)}' is not callable`);
|
|
2748
|
+
return E.apply(C, v), o;
|
|
2749
|
+
};
|
|
2750
|
+
t.set(a, p), s.set(
|
|
2751
|
+
a,
|
|
2752
|
+
c ?? V.get(a)
|
|
2753
|
+
);
|
|
2754
|
+
}
|
|
2755
|
+
return t.get(a);
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
if (Reflect.has(l, a)) {
|
|
2759
|
+
const c = Reflect.get(l, a, l);
|
|
2760
|
+
return typeof c == "function" ? a === "clone" ? (...u) => {
|
|
2761
|
+
const f = c.apply(l, u);
|
|
2762
|
+
return f && typeof f == "object" ? he(f) : f;
|
|
2763
|
+
} : (r.has(a) || r.set(a, c.bind(l)), r.get(a)) : c;
|
|
2764
|
+
}
|
|
2765
|
+
},
|
|
2766
|
+
has(l, a) {
|
|
2767
|
+
if (a === "modifiers" || a === "modifier" || a === "modifierBuilder")
|
|
2768
|
+
return !0;
|
|
2769
|
+
if (typeof a == "string") {
|
|
2770
|
+
const h = l._modifiableComponent || $(l), c = h?.modifierBuilder || h?.modifier;
|
|
2771
|
+
if (c && typeof c[a] == "function")
|
|
2772
|
+
return !0;
|
|
2773
|
+
}
|
|
2774
|
+
return Reflect.has(l, a) || V.has(a);
|
|
2775
|
+
},
|
|
2776
|
+
set(l, a, h, c) {
|
|
2777
|
+
if (a === "modifier")
|
|
2778
|
+
return Object.defineProperty(l, "modifier", {
|
|
2779
|
+
configurable: !0,
|
|
2780
|
+
enumerable: !1,
|
|
2781
|
+
writable: !0,
|
|
2782
|
+
value: h
|
|
2783
|
+
}), t.clear(), !0;
|
|
2784
|
+
if (a === "modifiers" && Array.isArray(h)) {
|
|
2785
|
+
const u = $(l);
|
|
2786
|
+
return u.modifiers = [...h], !0;
|
|
2787
|
+
}
|
|
2788
|
+
return Reflect.set(l, a, h, c);
|
|
2789
|
+
}
|
|
2790
|
+
}, o = new Proxy(n, i);
|
|
2791
|
+
return Se.set(n, o), o;
|
|
2792
|
+
}
|
|
2793
|
+
var jt = Object.defineProperty, Ft = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, x = (n, e, t) => Ft(n, typeof e != "symbol" ? e + "" : e, t);
|
|
2794
|
+
class Bt {
|
|
1672
2795
|
constructor(e, t) {
|
|
1673
|
-
|
|
2796
|
+
x(this, "id"), x(this, "parent"), x(this, "providers", /* @__PURE__ */ new Map()), x(this, "consumers", /* @__PURE__ */ new Set()), x(this, "cleanup", /* @__PURE__ */ new Set()), x(this, "stateStore", /* @__PURE__ */ new Map()), x(this, "bindingStore", /* @__PURE__ */ new Map()), x(this, "createdAt", Date.now()), x(this, "updateCount", 0), this.id = e, this.parent = t;
|
|
1674
2797
|
}
|
|
1675
2798
|
/**
|
|
1676
2799
|
* Store state value for a property
|
|
@@ -1754,16 +2877,16 @@ class nt {
|
|
|
1754
2877
|
};
|
|
1755
2878
|
}
|
|
1756
2879
|
}
|
|
1757
|
-
function
|
|
1758
|
-
return new
|
|
2880
|
+
function Wt(n, e) {
|
|
2881
|
+
return new Bt(n, e);
|
|
1759
2882
|
}
|
|
1760
|
-
var
|
|
1761
|
-
const
|
|
2883
|
+
var Ut = Object.defineProperty, qt = (n, e, t) => e in n ? Ut(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, H = (n, e, t) => qt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
2884
|
+
const Qt = class U {
|
|
1762
2885
|
constructor() {
|
|
1763
|
-
|
|
2886
|
+
H(this, "components", /* @__PURE__ */ new Map()), H(this, "contexts", /* @__PURE__ */ new Map()), H(this, "cleanupQueue", /* @__PURE__ */ new Set()), H(this, "updateQueue", /* @__PURE__ */ new Set()), H(this, "isUpdating", !1);
|
|
1764
2887
|
}
|
|
1765
2888
|
static getInstance() {
|
|
1766
|
-
return
|
|
2889
|
+
return U.instance || (U.instance = new U()), U.instance;
|
|
1767
2890
|
}
|
|
1768
2891
|
/**
|
|
1769
2892
|
* Register a new component instance
|
|
@@ -1855,14 +2978,14 @@ const ct = class k {
|
|
|
1855
2978
|
}), this.cleanupQueue.clear(), this.updateQueue.clear();
|
|
1856
2979
|
}
|
|
1857
2980
|
};
|
|
1858
|
-
|
|
1859
|
-
var
|
|
1860
|
-
const
|
|
2981
|
+
H(Qt, "instance");
|
|
2982
|
+
var Gt = Object.defineProperty, Kt = (n, e, t) => e in n ? Gt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, M = (n, e, t) => Kt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
2983
|
+
const $e = class q {
|
|
1861
2984
|
constructor() {
|
|
1862
|
-
|
|
2985
|
+
M(this, "contexts", /* @__PURE__ */ new Map()), M(this, "providerStack", /* @__PURE__ */ new Map()), M(this, "currentComponent", null);
|
|
1863
2986
|
}
|
|
1864
2987
|
static getInstance() {
|
|
1865
|
-
return
|
|
2988
|
+
return q.instance || (q.instance = new q()), q.instance;
|
|
1866
2989
|
}
|
|
1867
2990
|
/**
|
|
1868
2991
|
* Set the current component context for provider resolution
|
|
@@ -1881,15 +3004,15 @@ const ce = class z {
|
|
|
1881
3004
|
*/
|
|
1882
3005
|
registerProvider(e, t, s) {
|
|
1883
3006
|
this.providerStack.has(e) || this.providerStack.set(e, []);
|
|
1884
|
-
const r = this.providerStack.get(e), [i, o] =
|
|
3007
|
+
const r = this.providerStack.get(e), [i, o] = le(t), l = {
|
|
1885
3008
|
value: t,
|
|
1886
3009
|
signal: [i, o],
|
|
1887
3010
|
subscribers: /* @__PURE__ */ new Set(),
|
|
1888
3011
|
providers: /* @__PURE__ */ new Set([s])
|
|
1889
3012
|
};
|
|
1890
|
-
return r.push(
|
|
1891
|
-
const
|
|
1892
|
-
|
|
3013
|
+
return r.push(l), s.providers.set(e, l), () => {
|
|
3014
|
+
const a = r.indexOf(l);
|
|
3015
|
+
a !== -1 && r.splice(a, 1), s.providers.delete(e), l.subscribers.clear(), l.providers.clear();
|
|
1893
3016
|
};
|
|
1894
3017
|
}
|
|
1895
3018
|
/**
|
|
@@ -1899,7 +3022,7 @@ const ce = class z {
|
|
|
1899
3022
|
const s = this.providerStack.get(e), r = s && s.length > 0 ? s[s.length - 1] : null;
|
|
1900
3023
|
if (r)
|
|
1901
3024
|
return this.currentComponent && (r.subscribers.add(this.currentComponent.id), this.currentComponent.consumers.add(e)), [r.signal[0], !0];
|
|
1902
|
-
const [i] =
|
|
3025
|
+
const [i] = le(t);
|
|
1903
3026
|
return [i, !1];
|
|
1904
3027
|
}
|
|
1905
3028
|
/**
|
|
@@ -1925,10 +3048,10 @@ const ce = class z {
|
|
|
1925
3048
|
this.contexts.clear(), this.providerStack.clear(), this.currentComponent = null;
|
|
1926
3049
|
}
|
|
1927
3050
|
};
|
|
1928
|
-
|
|
1929
|
-
let
|
|
3051
|
+
M($e, "instance");
|
|
3052
|
+
let Yt = $e, Zt = class {
|
|
1930
3053
|
constructor() {
|
|
1931
|
-
|
|
3054
|
+
M(this, "registry", Yt.getInstance());
|
|
1932
3055
|
}
|
|
1933
3056
|
/**
|
|
1934
3057
|
* Create a context provider component
|
|
@@ -1940,12 +3063,12 @@ let ut = ce, pt = class {
|
|
|
1940
3063
|
const r = this.registry.registerProvider(
|
|
1941
3064
|
e.symbol,
|
|
1942
3065
|
t,
|
|
1943
|
-
|
|
3066
|
+
Wt(`provider_${e.symbol.toString()}`)
|
|
1944
3067
|
), i = s.flatMap((o) => {
|
|
1945
|
-
let
|
|
1946
|
-
"build" in o && typeof o.build == "function" && (
|
|
1947
|
-
const
|
|
1948
|
-
return Array.isArray(
|
|
3068
|
+
let l = o;
|
|
3069
|
+
"build" in o && typeof o.build == "function" && (l = o.build());
|
|
3070
|
+
const a = l.render();
|
|
3071
|
+
return Array.isArray(a) ? a : [a];
|
|
1949
3072
|
});
|
|
1950
3073
|
return [
|
|
1951
3074
|
{
|
|
@@ -1987,9 +3110,9 @@ let ut = ce, pt = class {
|
|
|
1987
3110
|
this.registry.clear();
|
|
1988
3111
|
}
|
|
1989
3112
|
};
|
|
1990
|
-
class
|
|
3113
|
+
class Xt {
|
|
1991
3114
|
constructor() {
|
|
1992
|
-
|
|
3115
|
+
M(this, "services", /* @__PURE__ */ new Map()), M(this, "factories", /* @__PURE__ */ new Map()), M(this, "singletons", /* @__PURE__ */ new Map()), M(this, "scoped", /* @__PURE__ */ new Map()), M(this, "dependencies", /* @__PURE__ */ new Map());
|
|
1993
3116
|
}
|
|
1994
3117
|
/**
|
|
1995
3118
|
* Register a service with the container
|
|
@@ -2049,11 +3172,11 @@ class ft {
|
|
|
2049
3172
|
return [...this.services.keys(), ...this.factories.keys()];
|
|
2050
3173
|
}
|
|
2051
3174
|
}
|
|
2052
|
-
new
|
|
2053
|
-
new
|
|
2054
|
-
new
|
|
2055
|
-
var
|
|
2056
|
-
const
|
|
3175
|
+
new Xt();
|
|
3176
|
+
new Zt();
|
|
3177
|
+
new Ie();
|
|
3178
|
+
var Jt = Object.defineProperty, es = (n, e, t) => e in n ? Jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ae = (n, e, t) => es(n, typeof e != "symbol" ? e + "" : e, t);
|
|
3179
|
+
const ts = {
|
|
2057
3180
|
sanitizeClassNames: !0,
|
|
2058
3181
|
sanitizationRules: {
|
|
2059
3182
|
allowNumbers: !0,
|
|
@@ -2065,9 +3188,9 @@ const yt = {
|
|
|
2065
3188
|
warnDuplicateClasses: process.env.NODE_ENV === "development",
|
|
2066
3189
|
warnInvalidClasses: process.env.NODE_ENV === "development"
|
|
2067
3190
|
};
|
|
2068
|
-
class
|
|
3191
|
+
let ss = class {
|
|
2069
3192
|
constructor(e = {}) {
|
|
2070
|
-
|
|
3193
|
+
ae(this, "config"), ae(this, "classCache"), ae(this, "processingCache"), this.config = { ...ts, ...e };
|
|
2071
3194
|
const t = (() => {
|
|
2072
3195
|
try {
|
|
2073
3196
|
return typeof Map < "u" && typeof Map == "function";
|
|
@@ -2134,7 +3257,7 @@ class vt {
|
|
|
2134
3257
|
*/
|
|
2135
3258
|
processClasses(e) {
|
|
2136
3259
|
if (!e) return [];
|
|
2137
|
-
if (
|
|
3260
|
+
if (F(e) || B(e)) {
|
|
2138
3261
|
const i = e();
|
|
2139
3262
|
return this.processClasses(i);
|
|
2140
3263
|
}
|
|
@@ -2240,24 +3363,123 @@ class vt {
|
|
|
2240
3363
|
}
|
|
2241
3364
|
this.cacheSet(this.classCache, e, t);
|
|
2242
3365
|
}
|
|
3366
|
+
};
|
|
3367
|
+
new ss();
|
|
3368
|
+
function rs(n, e, t = {}, ...s) {
|
|
3369
|
+
const r = new n(e, ...s);
|
|
3370
|
+
return Te() && t.prewarmProxy !== !1 && he(r), r;
|
|
2243
3371
|
}
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
class Ct {
|
|
3372
|
+
var is = Object.defineProperty, ns = (n, e, t) => e in n ? is(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, D = (n, e, t) => ns(n, typeof e != "symbol" ? e + "" : e, t);
|
|
3373
|
+
let os = class de extends Pe {
|
|
2247
3374
|
constructor(e) {
|
|
2248
|
-
this.props = e,
|
|
3375
|
+
super(), this.props = e, D(this, "type", "component"), D(this, "id"), D(this, "mounted", !1), D(this, "cleanup", []), D(this, "effectiveTag"), D(this, "validationResult"), this.id = `text-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
3376
|
+
const t = this.resolveDefaultTag(), s = ke(
|
|
3377
|
+
"Text",
|
|
3378
|
+
t,
|
|
3379
|
+
this.props.element
|
|
3380
|
+
);
|
|
3381
|
+
this.effectiveTag = s.tag, this.validationResult = s.validation;
|
|
3382
|
+
}
|
|
3383
|
+
resolveDefaultTag() {
|
|
3384
|
+
return this.props.accessibilityRole === "heading" ? `h${this.props.accessibilityLevel ?? 2}` : "span";
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3387
|
+
* Render the text component with reactive content handling, element override support, and CSS classes
|
|
3388
|
+
*/
|
|
3389
|
+
render() {
|
|
3390
|
+
const e = ["tachui-text"], t = this.createClassString(this.props, e);
|
|
3391
|
+
return [w(
|
|
3392
|
+
this.effectiveTag,
|
|
3393
|
+
{
|
|
3394
|
+
className: t,
|
|
3395
|
+
// Pass through debug label for debug system
|
|
3396
|
+
...this.props.debugLabel && { debugLabel: this.props.debugLabel },
|
|
3397
|
+
// Add component metadata for semantic role processing
|
|
3398
|
+
componentMetadata: {
|
|
3399
|
+
originalType: "Text",
|
|
3400
|
+
overriddenTo: this.effectiveTag !== "span" ? this.effectiveTag : void 0,
|
|
3401
|
+
validationResult: this.validationResult,
|
|
3402
|
+
componentInstance: this
|
|
3403
|
+
// Add reference to the Text component instance
|
|
3404
|
+
}
|
|
3405
|
+
},
|
|
3406
|
+
Le(this.props.content || "")
|
|
3407
|
+
)];
|
|
3408
|
+
}
|
|
3409
|
+
// Concatenation support - simplified for now
|
|
3410
|
+
concat(e) {
|
|
3411
|
+
return this;
|
|
3412
|
+
}
|
|
3413
|
+
toSegment() {
|
|
3414
|
+
return this;
|
|
3415
|
+
}
|
|
3416
|
+
isConcatenatable() {
|
|
3417
|
+
return !0;
|
|
3418
|
+
}
|
|
3419
|
+
/**
|
|
3420
|
+
* Cleanup resources
|
|
3421
|
+
*/
|
|
3422
|
+
dispose() {
|
|
3423
|
+
this.cleanup.forEach((e) => {
|
|
3424
|
+
try {
|
|
3425
|
+
e();
|
|
3426
|
+
} catch (t) {
|
|
3427
|
+
console.error("Text component cleanup error:", t);
|
|
3428
|
+
}
|
|
3429
|
+
}), this.cleanup = [];
|
|
3430
|
+
}
|
|
3431
|
+
clone(e = {}) {
|
|
3432
|
+
return e.deep ? this.deepClone() : this.shallowClone();
|
|
3433
|
+
}
|
|
3434
|
+
shallowClone() {
|
|
3435
|
+
const e = fe(this.props), t = new de(e);
|
|
3436
|
+
return me(t), t;
|
|
3437
|
+
}
|
|
3438
|
+
deepClone() {
|
|
3439
|
+
const e = fe(this.props, {
|
|
3440
|
+
deep: !0
|
|
3441
|
+
}), t = new de(e);
|
|
3442
|
+
return me(t), t;
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
function Ne(n, e) {
|
|
3446
|
+
const t = {
|
|
3447
|
+
content: n,
|
|
3448
|
+
...e
|
|
3449
|
+
}, s = rs(os, t);
|
|
3450
|
+
return ue(s);
|
|
3451
|
+
}
|
|
3452
|
+
function z(n) {
|
|
3453
|
+
return (e, t) => Ne(e, {
|
|
3454
|
+
...t,
|
|
3455
|
+
accessibilityRole: "heading",
|
|
3456
|
+
accessibilityLevel: n
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
Object.assign(Ne, {
|
|
3460
|
+
H1: z(1),
|
|
3461
|
+
H2: z(2),
|
|
3462
|
+
H3: z(3),
|
|
3463
|
+
H4: z(4),
|
|
3464
|
+
H5: z(5),
|
|
3465
|
+
H6: z(6)
|
|
3466
|
+
});
|
|
3467
|
+
var as = Object.defineProperty, ls = (n, e, t) => e in n ? as(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, g = (n, e, t) => ls(n, typeof e != "symbol" ? e + "" : e, t);
|
|
3468
|
+
class cs {
|
|
3469
|
+
constructor(e) {
|
|
3470
|
+
this.props = e, g(this, "type", "component"), g(this, "id"), g(this, "mounted", !1), g(this, "cleanup", []), g(this, "scrollElement", null), g(this, "contentOffsetSignal"), g(this, "setContentOffset"), g(this, "contentSizeSignal"), g(this, "setContentSize"), g(this, "setIsScrolling"), g(this, "pullToRefreshStateSignal"), g(this, "setPullToRefreshState"), g(this, "scrollEventThrottle"), g(this, "lastScrollTime", 0), g(this, "scrollVelocity", { x: 0, y: 0 }), g(this, "lastScrollOffset", { x: 0, y: 0 }), g(this, "pullStartY", 0), g(this, "isPulling", !1), g(this, "handleScroll", (h) => {
|
|
2249
3471
|
if (!this.scrollElement) return;
|
|
2250
|
-
const
|
|
2251
|
-
if (
|
|
3472
|
+
const c = performance.now(), u = c - this.lastScrollTime;
|
|
3473
|
+
if (u < this.scrollEventThrottle) return;
|
|
2252
3474
|
const f = {
|
|
2253
3475
|
x: this.scrollElement.scrollLeft,
|
|
2254
3476
|
y: this.scrollElement.scrollTop
|
|
2255
3477
|
};
|
|
2256
|
-
this.scrollVelocity = this.calculateVelocity(f,
|
|
3478
|
+
this.scrollVelocity = this.calculateVelocity(f, u), this.setContentOffset(f), this.setContentSize({
|
|
2257
3479
|
width: this.scrollElement.scrollWidth,
|
|
2258
3480
|
height: this.scrollElement.scrollHeight
|
|
2259
3481
|
});
|
|
2260
|
-
const p = this.detectScrollEdges(),
|
|
3482
|
+
const p = this.detectScrollEdges(), v = {
|
|
2261
3483
|
offset: f,
|
|
2262
3484
|
velocity: this.scrollVelocity,
|
|
2263
3485
|
contentSize: {
|
|
@@ -2270,25 +3492,25 @@ class Ct {
|
|
|
2270
3492
|
},
|
|
2271
3493
|
edges: p
|
|
2272
3494
|
};
|
|
2273
|
-
this.props.onScroll && this.props.onScroll(
|
|
2274
|
-
}),
|
|
3495
|
+
this.props.onScroll && this.props.onScroll(v), p.top && this.props.onReachTop && this.props.onReachTop(), p.bottom && this.props.onReachBottom && this.props.onReachBottom(), p.left && this.props.onReachLeft && this.props.onReachLeft(), p.right && this.props.onReachRight && this.props.onReachRight(), this.lastScrollOffset = f, this.lastScrollTime = c;
|
|
3496
|
+
}), g(this, "handleScrollStart", () => {
|
|
2275
3497
|
this.setIsScrolling(!0), this.props.onScrollBegin && this.props.onScrollBegin();
|
|
2276
|
-
}),
|
|
3498
|
+
}), g(this, "handleScrollEnd", () => {
|
|
2277
3499
|
this.setIsScrolling(!1), this.props.onScrollEnd && this.props.onScrollEnd();
|
|
2278
|
-
}),
|
|
2279
|
-
this.props.refreshControl?.enabled && (this.pullStartY =
|
|
2280
|
-
}),
|
|
3500
|
+
}), g(this, "handleTouchStart", (h) => {
|
|
3501
|
+
this.props.refreshControl?.enabled && (this.pullStartY = h.touches[0].clientY, this.isPulling = !1);
|
|
3502
|
+
}), g(this, "handleTouchMove", (h) => {
|
|
2281
3503
|
if (!this.props.refreshControl?.enabled || !this.scrollElement) return;
|
|
2282
|
-
const
|
|
2283
|
-
this.scrollElement.scrollTop <= 0 &&
|
|
2284
|
-
}),
|
|
3504
|
+
const c = h.touches[0].clientY - this.pullStartY, u = this.props.refreshControl.threshold || 80;
|
|
3505
|
+
this.scrollElement.scrollTop <= 0 && c > 0 && (this.isPulling = !0, c > u ? this.setPullToRefreshState("ready") : this.setPullToRefreshState("pulling"));
|
|
3506
|
+
}), g(this, "handleTouchEnd", async () => {
|
|
2285
3507
|
if (!(!this.props.refreshControl?.enabled || !this.isPulling)) {
|
|
2286
3508
|
if (this.pullToRefreshStateSignal() === "ready") {
|
|
2287
3509
|
this.setPullToRefreshState("refreshing");
|
|
2288
3510
|
try {
|
|
2289
3511
|
await this.props.refreshControl.onRefresh();
|
|
2290
|
-
} catch (
|
|
2291
|
-
console.error("Pull to refresh error:",
|
|
3512
|
+
} catch (h) {
|
|
3513
|
+
console.error("Pull to refresh error:", h);
|
|
2292
3514
|
} finally {
|
|
2293
3515
|
this.setPullToRefreshState("idle");
|
|
2294
3516
|
}
|
|
@@ -2297,31 +3519,31 @@ class Ct {
|
|
|
2297
3519
|
this.isPulling = !1;
|
|
2298
3520
|
}
|
|
2299
3521
|
}), this.id = `scrollview-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.scrollEventThrottle = e.scrollEventThrottle || 16;
|
|
2300
|
-
const [t, s] =
|
|
3522
|
+
const [t, s] = N(
|
|
2301
3523
|
{ x: 0, y: 0 }
|
|
2302
3524
|
);
|
|
2303
3525
|
this.contentOffsetSignal = t, this.setContentOffset = s;
|
|
2304
|
-
const [r, i] =
|
|
3526
|
+
const [r, i] = N({
|
|
2305
3527
|
width: 0,
|
|
2306
3528
|
height: 0
|
|
2307
3529
|
});
|
|
2308
3530
|
this.contentSizeSignal = r, this.setContentSize = i;
|
|
2309
|
-
const [, o] =
|
|
3531
|
+
const [, o] = N(!1);
|
|
2310
3532
|
this.setIsScrolling = o;
|
|
2311
|
-
const [
|
|
2312
|
-
if (this.pullToRefreshStateSignal =
|
|
3533
|
+
const [l, a] = N("idle");
|
|
3534
|
+
if (this.pullToRefreshStateSignal = l, this.setPullToRefreshState = a, e.contentOffset && S(e.contentOffset)) {
|
|
2313
3535
|
this.setContentOffset(e.contentOffset());
|
|
2314
|
-
const
|
|
2315
|
-
e.contentOffset &&
|
|
3536
|
+
const h = R(() => {
|
|
3537
|
+
e.contentOffset && S(e.contentOffset) && this.setContentOffset(e.contentOffset());
|
|
2316
3538
|
});
|
|
2317
|
-
this.cleanup.push(() =>
|
|
3539
|
+
this.cleanup.push(() => h.dispose());
|
|
2318
3540
|
}
|
|
2319
|
-
if (e.contentSize &&
|
|
3541
|
+
if (e.contentSize && S(e.contentSize)) {
|
|
2320
3542
|
this.setContentSize(e.contentSize());
|
|
2321
|
-
const
|
|
2322
|
-
e.contentSize &&
|
|
3543
|
+
const h = R(() => {
|
|
3544
|
+
e.contentSize && S(e.contentSize) && this.setContentSize(e.contentSize());
|
|
2323
3545
|
});
|
|
2324
|
-
this.cleanup.push(() =>
|
|
3546
|
+
this.cleanup.push(() => h.dispose());
|
|
2325
3547
|
}
|
|
2326
3548
|
}
|
|
2327
3549
|
/**
|
|
@@ -2458,7 +3680,7 @@ class Ct {
|
|
|
2458
3680
|
cleanup: [],
|
|
2459
3681
|
props: {},
|
|
2460
3682
|
render: () => [
|
|
2461
|
-
|
|
3683
|
+
w(
|
|
2462
3684
|
"div",
|
|
2463
3685
|
{
|
|
2464
3686
|
style: {
|
|
@@ -2517,10 +3739,10 @@ class Ct {
|
|
|
2517
3739
|
let s = [];
|
|
2518
3740
|
const r = e;
|
|
2519
3741
|
if (typeof r == "function") {
|
|
2520
|
-
const
|
|
2521
|
-
s = Array.isArray(
|
|
3742
|
+
const u = r();
|
|
3743
|
+
s = Array.isArray(u) ? u : [];
|
|
2522
3744
|
} else Array.isArray(e) && (s = e);
|
|
2523
|
-
const i =
|
|
3745
|
+
const i = w(
|
|
2524
3746
|
"div",
|
|
2525
3747
|
{
|
|
2526
3748
|
class: "tachui-scrollview-content",
|
|
@@ -2529,14 +3751,14 @@ class Ct {
|
|
|
2529
3751
|
minWidth: "100%"
|
|
2530
3752
|
}
|
|
2531
3753
|
},
|
|
2532
|
-
...s.flatMap((
|
|
2533
|
-
), o = this.createPullToRefreshIndicator(),
|
|
3754
|
+
...s.flatMap((u) => u.render())
|
|
3755
|
+
), o = this.createPullToRefreshIndicator(), l = [];
|
|
2534
3756
|
if (o) {
|
|
2535
|
-
const
|
|
2536
|
-
|
|
3757
|
+
const u = o.render(), f = Array.isArray(u) ? u : [u];
|
|
3758
|
+
l.push(...f.filter((p) => p));
|
|
2537
3759
|
}
|
|
2538
|
-
|
|
2539
|
-
const { direction:
|
|
3760
|
+
l.push(i);
|
|
3761
|
+
const { direction: a = "vertical" } = this.props, h = this.getOverflowStyles(a), c = w(
|
|
2540
3762
|
"div",
|
|
2541
3763
|
{
|
|
2542
3764
|
id: this.id,
|
|
@@ -2545,44 +3767,44 @@ class Ct {
|
|
|
2545
3767
|
height: "100%",
|
|
2546
3768
|
width: "100%",
|
|
2547
3769
|
position: "relative",
|
|
2548
|
-
...
|
|
3770
|
+
...h
|
|
2549
3771
|
}
|
|
2550
3772
|
},
|
|
2551
|
-
...
|
|
3773
|
+
...l
|
|
2552
3774
|
);
|
|
2553
|
-
if (
|
|
2554
|
-
const
|
|
2555
|
-
this.scrollElement =
|
|
3775
|
+
if (c.element) {
|
|
3776
|
+
const u = c.element;
|
|
3777
|
+
this.scrollElement = u, this.applyScrollViewStyles(u), this.setupScrollHandlers(u), i.element && this.applyContentInsets(i.element);
|
|
2556
3778
|
const f = () => {
|
|
2557
|
-
const p =
|
|
2558
|
-
|
|
3779
|
+
const p = S(t) ? t() : t;
|
|
3780
|
+
u.style.overflow = p ? "auto" : "hidden", u.style.pointerEvents = p ? "auto" : "none";
|
|
2559
3781
|
};
|
|
2560
|
-
if (
|
|
2561
|
-
const p =
|
|
3782
|
+
if (S(t)) {
|
|
3783
|
+
const p = R(f);
|
|
2562
3784
|
this.cleanup.push(() => p.dispose());
|
|
2563
3785
|
} else
|
|
2564
3786
|
f();
|
|
2565
3787
|
if (typeof r == "function") {
|
|
2566
|
-
const p =
|
|
2567
|
-
const
|
|
3788
|
+
const p = R(() => {
|
|
3789
|
+
const v = r(), k = (Array.isArray(v) ? v : []).flatMap((C) => C.render());
|
|
2568
3790
|
if (i.element) {
|
|
2569
|
-
const
|
|
2570
|
-
|
|
2571
|
-
|
|
3791
|
+
const C = i.element;
|
|
3792
|
+
C.innerHTML = "", k.forEach((E) => {
|
|
3793
|
+
E && E.element && C.appendChild(E.element);
|
|
2572
3794
|
});
|
|
2573
3795
|
}
|
|
2574
3796
|
});
|
|
2575
3797
|
this.cleanup.push(() => p.dispose());
|
|
2576
3798
|
}
|
|
2577
3799
|
}
|
|
2578
|
-
return [
|
|
3800
|
+
return [c];
|
|
2579
3801
|
}
|
|
2580
3802
|
}
|
|
2581
|
-
function
|
|
2582
|
-
const e = new
|
|
2583
|
-
return
|
|
3803
|
+
function hs(n = {}) {
|
|
3804
|
+
const e = new cs(n);
|
|
3805
|
+
return ue(e);
|
|
2584
3806
|
}
|
|
2585
|
-
const
|
|
3807
|
+
const ds = `
|
|
2586
3808
|
@keyframes spin {
|
|
2587
3809
|
from { transform: rotate(0deg); }
|
|
2588
3810
|
to { transform: rotate(360deg); }
|
|
@@ -2590,51 +3812,51 @@ const wt = `
|
|
|
2590
3812
|
`;
|
|
2591
3813
|
if (typeof document < "u") {
|
|
2592
3814
|
const n = document.createElement("style");
|
|
2593
|
-
n.textContent =
|
|
3815
|
+
n.textContent = ds, document.head.appendChild(n);
|
|
2594
3816
|
}
|
|
2595
3817
|
process.env.NODE_ENV;
|
|
2596
|
-
class
|
|
3818
|
+
class us {
|
|
2597
3819
|
constructor(e) {
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
3820
|
+
m(this, "type", "component");
|
|
3821
|
+
m(this, "id");
|
|
3822
|
+
m(this, "mounted", !1);
|
|
3823
|
+
m(this, "cleanup", []);
|
|
3824
|
+
m(this, "dataSignal");
|
|
3825
|
+
m(this, "setData");
|
|
3826
|
+
m(this, "sectionsSignal");
|
|
3827
|
+
m(this, "setSections");
|
|
3828
|
+
m(this, "selectedItemsSignal");
|
|
3829
|
+
m(this, "setSelectedItems");
|
|
3830
|
+
m(this, "isLoadingSignal");
|
|
3831
|
+
m(this, "setIsLoading");
|
|
2610
3832
|
// Virtual scrolling state
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
3833
|
+
m(this, "virtualItems", []);
|
|
3834
|
+
m(this, "visibleStartIndex", 0);
|
|
3835
|
+
m(this, "visibleEndIndex", 0);
|
|
3836
|
+
m(this, "scrollOffset", 0);
|
|
3837
|
+
m(this, "containerHeight", 0);
|
|
3838
|
+
m(this, "totalHeight", 0);
|
|
2617
3839
|
/**
|
|
2618
3840
|
* Handle scroll events for virtual scrolling and infinite scroll
|
|
2619
3841
|
*/
|
|
2620
|
-
|
|
2621
|
-
this.scrollOffset = e.offset.y, this.containerHeight = e.containerSize.height, this.props.virtualScrolling?.enabled && this.calculateVisibleRange(), this.props.onLoadMore && e.edges.bottom && (
|
|
3842
|
+
m(this, "handleListScroll", (e) => {
|
|
3843
|
+
this.scrollOffset = e.offset.y, this.containerHeight = e.containerSize.height, this.props.virtualScrolling?.enabled && this.calculateVisibleRange(), this.props.onLoadMore && e.edges.bottom && (S(this.props.hasMore) ? this.props.hasMore() : this.props.hasMore) && !this.isLoadingSignal() && (this.setIsLoading(!0), this.props.onLoadMore().finally(() => {
|
|
2622
3844
|
this.setIsLoading(!1);
|
|
2623
3845
|
})), this.props.onScroll && this.props.onScroll(e);
|
|
2624
3846
|
});
|
|
2625
3847
|
this.props = e, this.id = `list-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2626
|
-
const [t, s] =
|
|
3848
|
+
const [t, s] = N(this.resolveData());
|
|
2627
3849
|
this.dataSignal = t, this.setData = s;
|
|
2628
|
-
const [r, i] =
|
|
3850
|
+
const [r, i] = N(
|
|
2629
3851
|
this.resolveSections()
|
|
2630
3852
|
);
|
|
2631
3853
|
this.sectionsSignal = r, this.setSections = i;
|
|
2632
|
-
const o = /* @__PURE__ */ new Set(), [
|
|
2633
|
-
this.selectedItemsSignal =
|
|
2634
|
-
const [
|
|
3854
|
+
const o = /* @__PURE__ */ new Set(), [l, a] = N(o);
|
|
3855
|
+
this.selectedItemsSignal = l, this.setSelectedItems = a;
|
|
3856
|
+
const [h, c] = N(
|
|
2635
3857
|
this.resolveIsLoading()
|
|
2636
3858
|
);
|
|
2637
|
-
this.isLoadingSignal =
|
|
3859
|
+
this.isLoadingSignal = h, this.setIsLoading = c, this.setupReactiveUpdates(), e.virtualScrolling?.enabled && this.initializeVirtualScrolling();
|
|
2638
3860
|
}
|
|
2639
3861
|
/**
|
|
2640
3862
|
* Helper to flatten render results
|
|
@@ -2656,46 +3878,46 @@ class At {
|
|
|
2656
3878
|
*/
|
|
2657
3879
|
resolveData() {
|
|
2658
3880
|
const { data: e } = this.props;
|
|
2659
|
-
return Array.isArray(e) ? e :
|
|
3881
|
+
return Array.isArray(e) ? e : S(e) ? e() : [];
|
|
2660
3882
|
}
|
|
2661
3883
|
/**
|
|
2662
3884
|
* Resolve sections from various input types
|
|
2663
3885
|
*/
|
|
2664
3886
|
resolveSections() {
|
|
2665
3887
|
const { sections: e } = this.props;
|
|
2666
|
-
return Array.isArray(e) ? e :
|
|
3888
|
+
return Array.isArray(e) ? e : S(e) ? e() : [];
|
|
2667
3889
|
}
|
|
2668
3890
|
/**
|
|
2669
3891
|
* Resolve loading state
|
|
2670
3892
|
*/
|
|
2671
3893
|
resolveIsLoading() {
|
|
2672
3894
|
const { isLoading: e } = this.props;
|
|
2673
|
-
return typeof e == "boolean" ? e :
|
|
3895
|
+
return typeof e == "boolean" ? e : S(e) ? e() : !1;
|
|
2674
3896
|
}
|
|
2675
3897
|
/**
|
|
2676
3898
|
* Set up reactive updates for data and state
|
|
2677
3899
|
*/
|
|
2678
3900
|
setupReactiveUpdates() {
|
|
2679
|
-
if (
|
|
2680
|
-
const e =
|
|
3901
|
+
if (S(this.props.data)) {
|
|
3902
|
+
const e = R(() => {
|
|
2681
3903
|
this.setData(this.resolveData()), this.updateVirtualScrolling();
|
|
2682
3904
|
});
|
|
2683
3905
|
this.cleanup.push(() => e.dispose());
|
|
2684
3906
|
}
|
|
2685
|
-
if (
|
|
2686
|
-
const e =
|
|
3907
|
+
if (S(this.props.sections)) {
|
|
3908
|
+
const e = R(() => {
|
|
2687
3909
|
this.setSections(this.resolveSections()), this.updateVirtualScrolling();
|
|
2688
3910
|
});
|
|
2689
3911
|
this.cleanup.push(() => e.dispose());
|
|
2690
3912
|
}
|
|
2691
|
-
if (
|
|
2692
|
-
const e =
|
|
3913
|
+
if (S(this.props.isLoading)) {
|
|
3914
|
+
const e = R(() => {
|
|
2693
3915
|
this.setIsLoading(this.resolveIsLoading());
|
|
2694
3916
|
});
|
|
2695
3917
|
this.cleanup.push(() => e.dispose());
|
|
2696
3918
|
}
|
|
2697
3919
|
if (this.props.selectedItems) {
|
|
2698
|
-
const e =
|
|
3920
|
+
const e = R(() => {
|
|
2699
3921
|
this.props.selectedItems && this.setSelectedItems(this.props.selectedItems());
|
|
2700
3922
|
});
|
|
2701
3923
|
this.cleanup.push(() => e.dispose());
|
|
@@ -2745,14 +3967,14 @@ class At {
|
|
|
2745
3967
|
handleItemSelection(e, t) {
|
|
2746
3968
|
const { selectionMode: s, getItemId: r, onSelectionChange: i } = this.props;
|
|
2747
3969
|
if (s === "none") return;
|
|
2748
|
-
const o = r ? r(e, t) : t,
|
|
2749
|
-
s === "single" ? (
|
|
3970
|
+
const o = r ? r(e, t) : t, l = new Set(this.selectedItemsSignal());
|
|
3971
|
+
s === "single" ? (l.clear(), l.add(o)) : s === "multiple" && (l.has(o) ? l.delete(o) : l.add(o)), this.setSelectedItems(l), i && i(l);
|
|
2750
3972
|
}
|
|
2751
3973
|
/**
|
|
2752
3974
|
* Create list item component
|
|
2753
3975
|
*/
|
|
2754
3976
|
createListItem(e, t, s) {
|
|
2755
|
-
const { renderItem: r, style: i, onItemTap: o, onItemLongPress:
|
|
3977
|
+
const { renderItem: r, style: i, onItemTap: o, onItemLongPress: l } = this.props, a = r(e, t);
|
|
2756
3978
|
return {
|
|
2757
3979
|
type: "component",
|
|
2758
3980
|
id: `${this.id}-item-${t}`,
|
|
@@ -2760,7 +3982,7 @@ class At {
|
|
|
2760
3982
|
cleanup: [],
|
|
2761
3983
|
props: {},
|
|
2762
3984
|
render: () => {
|
|
2763
|
-
const
|
|
3985
|
+
const h = w(
|
|
2764
3986
|
"div",
|
|
2765
3987
|
{
|
|
2766
3988
|
class: `tachui-list-item tachui-list-item-${i || "plain"}`,
|
|
@@ -2773,27 +3995,27 @@ class At {
|
|
|
2773
3995
|
cursor: o ? "pointer" : "default"
|
|
2774
3996
|
}
|
|
2775
3997
|
},
|
|
2776
|
-
...this.normalizeItemRenderOutput(
|
|
3998
|
+
...this.normalizeItemRenderOutput(a)
|
|
2777
3999
|
);
|
|
2778
|
-
if (
|
|
2779
|
-
const
|
|
2780
|
-
if (o &&
|
|
2781
|
-
let
|
|
4000
|
+
if (h.element) {
|
|
4001
|
+
const c = h.element;
|
|
4002
|
+
if (o && c.addEventListener("click", () => o(e, t)), l) {
|
|
4003
|
+
let u;
|
|
2782
4004
|
const f = () => {
|
|
2783
|
-
|
|
2784
|
-
() =>
|
|
4005
|
+
u = setTimeout(
|
|
4006
|
+
() => l(e, t),
|
|
2785
4007
|
500
|
|
2786
4008
|
);
|
|
2787
4009
|
}, p = () => {
|
|
2788
|
-
clearTimeout(
|
|
4010
|
+
clearTimeout(u);
|
|
2789
4011
|
};
|
|
2790
|
-
|
|
4012
|
+
c.addEventListener("mousedown", f), c.addEventListener("mouseup", p), c.addEventListener("mouseleave", p), c.addEventListener("touchstart", f), c.addEventListener("touchend", p);
|
|
2791
4013
|
}
|
|
2792
|
-
this.props.selectionMode !== "none" &&
|
|
2793
|
-
(
|
|
4014
|
+
this.props.selectionMode !== "none" && c.addEventListener("click", (u) => {
|
|
4015
|
+
(u.metaKey || u.ctrlKey || this.props.selectionMode === "multiple") && (u.preventDefault(), this.handleItemSelection(e, t));
|
|
2794
4016
|
});
|
|
2795
4017
|
}
|
|
2796
|
-
return [
|
|
4018
|
+
return [h];
|
|
2797
4019
|
}
|
|
2798
4020
|
};
|
|
2799
4021
|
}
|
|
@@ -2809,7 +4031,7 @@ class At {
|
|
|
2809
4031
|
cleanup: [],
|
|
2810
4032
|
props: {},
|
|
2811
4033
|
render: () => [
|
|
2812
|
-
|
|
4034
|
+
w("div", {
|
|
2813
4035
|
class: "tachui-list-separator",
|
|
2814
4036
|
style: {
|
|
2815
4037
|
height: "1px",
|
|
@@ -2831,7 +4053,7 @@ class At {
|
|
|
2831
4053
|
cleanup: [],
|
|
2832
4054
|
props: {},
|
|
2833
4055
|
render: () => {
|
|
2834
|
-
const s =
|
|
4056
|
+
const s = w("div", {
|
|
2835
4057
|
class: "tachui-list-section-header",
|
|
2836
4058
|
style: {
|
|
2837
4059
|
padding: "8px 16px",
|
|
@@ -2858,7 +4080,7 @@ class At {
|
|
|
2858
4080
|
cleanup: [],
|
|
2859
4081
|
props: {},
|
|
2860
4082
|
render: () => {
|
|
2861
|
-
const s =
|
|
4083
|
+
const s = w("div", {
|
|
2862
4084
|
class: "tachui-list-section-footer",
|
|
2863
4085
|
style: {
|
|
2864
4086
|
padding: "8px 16px",
|
|
@@ -2882,7 +4104,7 @@ class At {
|
|
|
2882
4104
|
cleanup: [],
|
|
2883
4105
|
props: {},
|
|
2884
4106
|
render: () => [
|
|
2885
|
-
|
|
4107
|
+
w(
|
|
2886
4108
|
"div",
|
|
2887
4109
|
{
|
|
2888
4110
|
class: "tachui-list-empty",
|
|
@@ -2913,7 +4135,7 @@ class At {
|
|
|
2913
4135
|
cleanup: [],
|
|
2914
4136
|
props: {},
|
|
2915
4137
|
render: () => [
|
|
2916
|
-
|
|
4138
|
+
w(
|
|
2917
4139
|
"div",
|
|
2918
4140
|
{
|
|
2919
4141
|
class: "tachui-list-loading",
|
|
@@ -2946,15 +4168,15 @@ class At {
|
|
|
2946
4168
|
cleanup: [],
|
|
2947
4169
|
props: {},
|
|
2948
4170
|
render: () => [
|
|
2949
|
-
|
|
4171
|
+
w("div", {
|
|
2950
4172
|
style: { height: `${i}px` }
|
|
2951
4173
|
})
|
|
2952
4174
|
]
|
|
2953
4175
|
});
|
|
2954
4176
|
}
|
|
2955
4177
|
for (let i = this.visibleStartIndex; i <= this.visibleEndIndex && i < e.length; i++) {
|
|
2956
|
-
const o = e[i],
|
|
2957
|
-
r.push(this.createListItem(o, i,
|
|
4178
|
+
const o = e[i], l = this.props.getItemId ? this.props.getItemId(o, i) : i, a = t.has(l);
|
|
4179
|
+
r.push(this.createListItem(o, i, a)), s && i < e.length - 1 && r.push(s);
|
|
2958
4180
|
}
|
|
2959
4181
|
if (this.visibleEndIndex < e.length - 1) {
|
|
2960
4182
|
const i = this.totalHeight - (this.virtualItems[this.visibleEndIndex + 1]?.offset || 0);
|
|
@@ -2965,7 +4187,7 @@ class At {
|
|
|
2965
4187
|
cleanup: [],
|
|
2966
4188
|
props: {},
|
|
2967
4189
|
render: () => [
|
|
2968
|
-
|
|
4190
|
+
w("div", {
|
|
2969
4191
|
style: { height: `${i}px` }
|
|
2970
4192
|
})
|
|
2971
4193
|
]
|
|
@@ -2978,17 +4200,17 @@ class At {
|
|
|
2978
4200
|
*/
|
|
2979
4201
|
renderRegularContent() {
|
|
2980
4202
|
const e = this.dataSignal(), t = this.sectionsSignal(), s = this.selectedItemsSignal(), r = this.createSeparator(), i = [];
|
|
2981
|
-
return t.length > 0 ? t.forEach((o,
|
|
2982
|
-
const
|
|
2983
|
-
|
|
2984
|
-
const f =
|
|
2985
|
-
i.push(this.createListItem(
|
|
4203
|
+
return t.length > 0 ? t.forEach((o, l) => {
|
|
4204
|
+
const a = this.createSectionHeader(o, l);
|
|
4205
|
+
a && i.push(a), o.items.forEach((c, u) => {
|
|
4206
|
+
const f = l * 1e3 + u, p = this.props.getItemId ? this.props.getItemId(c, f) : f, v = s.has(p);
|
|
4207
|
+
i.push(this.createListItem(c, f, v)), r && u < o.items.length - 1 && i.push(r);
|
|
2986
4208
|
});
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2989
|
-
}) : e.forEach((o,
|
|
2990
|
-
const
|
|
2991
|
-
i.push(this.createListItem(o,
|
|
4209
|
+
const h = this.createSectionFooter(o, l);
|
|
4210
|
+
h && i.push(h);
|
|
4211
|
+
}) : e.forEach((o, l) => {
|
|
4212
|
+
const a = this.props.getItemId ? this.props.getItemId(o, l) : l, h = s.has(a);
|
|
4213
|
+
i.push(this.createListItem(o, l, h)), r && l < e.length - 1 && i.push(r);
|
|
2992
4214
|
}), i;
|
|
2993
4215
|
}
|
|
2994
4216
|
/**
|
|
@@ -3014,19 +4236,19 @@ class At {
|
|
|
3014
4236
|
children: s,
|
|
3015
4237
|
onScroll: this.handleListScroll
|
|
3016
4238
|
};
|
|
3017
|
-
return new
|
|
4239
|
+
return new hs(r).render();
|
|
3018
4240
|
}
|
|
3019
4241
|
}
|
|
3020
|
-
function
|
|
3021
|
-
const e = new
|
|
3022
|
-
return
|
|
4242
|
+
function Z(n) {
|
|
4243
|
+
const e = new us(n);
|
|
4244
|
+
return ue(e);
|
|
3023
4245
|
}
|
|
3024
|
-
const
|
|
4246
|
+
const Ms = {
|
|
3025
4247
|
/**
|
|
3026
4248
|
* Create a simple list from array
|
|
3027
4249
|
*/
|
|
3028
4250
|
simple(n, e, t = {}) {
|
|
3029
|
-
return
|
|
4251
|
+
return Z({
|
|
3030
4252
|
...t,
|
|
3031
4253
|
data: n,
|
|
3032
4254
|
renderItem: e
|
|
@@ -3036,7 +4258,7 @@ const kt = {
|
|
|
3036
4258
|
* Create a sectioned list
|
|
3037
4259
|
*/
|
|
3038
4260
|
sectioned(n, e, t = {}) {
|
|
3039
|
-
return
|
|
4261
|
+
return Z({
|
|
3040
4262
|
...t,
|
|
3041
4263
|
sections: n,
|
|
3042
4264
|
renderItem: e
|
|
@@ -3046,7 +4268,7 @@ const kt = {
|
|
|
3046
4268
|
* Create a virtual scrolling list for large datasets
|
|
3047
4269
|
*/
|
|
3048
4270
|
virtual(n, e, t, s = {}) {
|
|
3049
|
-
return
|
|
4271
|
+
return Z({
|
|
3050
4272
|
...s,
|
|
3051
4273
|
data: n,
|
|
3052
4274
|
renderItem: e,
|
|
@@ -3057,7 +4279,7 @@ const kt = {
|
|
|
3057
4279
|
* Create an infinite scrolling list
|
|
3058
4280
|
*/
|
|
3059
4281
|
infinite(n, e, t, s, r = {}) {
|
|
3060
|
-
return
|
|
4282
|
+
return Z({
|
|
3061
4283
|
...r,
|
|
3062
4284
|
data: n,
|
|
3063
4285
|
renderItem: e,
|
|
@@ -3067,7 +4289,7 @@ const kt = {
|
|
|
3067
4289
|
}
|
|
3068
4290
|
};
|
|
3069
4291
|
export {
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
4292
|
+
us as E,
|
|
4293
|
+
Z as L,
|
|
4294
|
+
Ms as a
|
|
3073
4295
|
};
|