@tachui/core 0.8.24 → 0.8.26
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/assets/ColorAsset.d.ts +1 -0
- package/dist/assets/ColorAsset.d.ts.map +1 -1
- package/dist/assets/FontAsset.d.ts +3 -0
- package/dist/assets/FontAsset.d.ts.map +1 -1
- package/dist/assets/ImageAsset.d.ts.map +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +196 -132
- package/dist/assets/ssr-context.d.ts +8 -0
- package/dist/assets/ssr-context.d.ts.map +1 -0
- package/dist/{binding-DCr-JHsC.js → binding-DNl4QUbT.js} +1 -1
- package/dist/common.js +388 -386
- package/dist/{component-BzvSm8rM.js → component-DR1wgdPH.js} +66 -69
- package/dist/{component-context-C7Y6Xu6h.js → component-context-BB80qzyZ.js} +66 -44
- package/dist/components/index.js +1 -1
- package/dist/{concatenated-component-CA54ng_j.js → concatenated-component-DisxEqg6.js} +123 -113
- package/dist/essential.js +390 -388
- package/dist/{factories-B05hE6kc.js → factories-Bz6LZlk6.js} +108 -99
- package/dist/{factory-B1YXfgU1.js → factory-C2LUc2BF.js} +2 -2
- package/dist/full.js +390 -388
- package/dist/{index-CmQmIgPK.js → index-B1zQAJuG.js} +91 -89
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +390 -388
- package/dist/minimal-prod.js +3 -3
- package/dist/minimal.js +5 -5
- package/dist/modifiers/base.d.ts +17 -0
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +169 -133
- package/dist/modifiers/builder.js +1 -1
- package/dist/modifiers/factories.d.ts.map +1 -1
- package/dist/modifiers/index.js +3 -3
- package/dist/modifiers/registry.js +1 -1
- package/dist/{observed-object-DCoyucmV.js → observed-object-gKl1Kk85.js} +1 -1
- package/dist/{optimization-D9t53vNJ.js → optimization-CnRxoggr.js} +1 -1
- package/dist/{proxy-B7ZIqGd0.js → proxy-B6FFddJq.js} +1 -1
- package/dist/runtime/component-context.d.ts +2 -0
- package/dist/runtime/component-context.d.ts.map +1 -1
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.js +2 -2
- package/dist/runtime/index.js +4 -4
- package/dist/runtime/lazy-component.d.ts.map +1 -1
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +1 -1
- package/dist/state/index.js +5 -5
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/modifiers/base.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { i as m, r as
|
|
2
|
-
import { c as
|
|
3
|
-
import { g as
|
|
4
|
-
import { a as
|
|
1
|
+
import { i as m, r as D } from "../computed-CA4Cgtoe.js";
|
|
2
|
+
import { c as S } from "../effect-DgNm6jk9.js";
|
|
3
|
+
import { g as z, i as b } from "../signal-BRoiFOO7.js";
|
|
4
|
+
import { a as B } from "../theme-D5-09a8N.js";
|
|
5
5
|
import { ModifierPriority as C } from "@tachui/types/modifiers";
|
|
6
|
-
import { shouldExpandForInfinity as
|
|
7
|
-
import { o as
|
|
6
|
+
import { shouldExpandForInfinity as _, dimensionToCSS as g, isInfinity as p } from "../constants/layout.js";
|
|
7
|
+
import { o as F } from "../cleanup-BR8UpYPX.js";
|
|
8
8
|
const L = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
let y = null;
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
10
|
+
function re(o) {
|
|
11
|
+
if (o === null)
|
|
12
12
|
return y = null, () => {
|
|
13
13
|
};
|
|
14
14
|
const i = y;
|
|
15
15
|
return y = (t, e) => {
|
|
16
|
-
i?.(t, e),
|
|
16
|
+
i?.(t, e), o(t, e);
|
|
17
17
|
}, () => {
|
|
18
18
|
y = i;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function I(o, i, t) {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
o(i);
|
|
24
24
|
} catch (e) {
|
|
25
25
|
if (y) {
|
|
26
26
|
y(e, { updaterId: t, value: i });
|
|
@@ -29,20 +29,20 @@ function k(s, i, t) {
|
|
|
29
29
|
console.error(`Reactive style updater failed (${t}):`, e);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
let P = !1,
|
|
34
|
-
function
|
|
35
|
-
u.get(
|
|
32
|
+
const k = 200, u = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new Set();
|
|
33
|
+
let P = !1, $ = !1;
|
|
34
|
+
function W(o) {
|
|
35
|
+
u.get(o)?.forEach((t) => t()), u.delete(o), M.delete(o);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
37
|
+
function V() {
|
|
38
|
+
const o = Date.now();
|
|
39
39
|
for (const i of Array.from(v)) {
|
|
40
40
|
const t = i.deref();
|
|
41
41
|
if (!t) {
|
|
42
42
|
v.delete(i);
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
|
-
const e =
|
|
45
|
+
const e = M.get(t), n = u.get(t);
|
|
46
46
|
if (!e || !n || n.size === 0) {
|
|
47
47
|
v.delete(i);
|
|
48
48
|
continue;
|
|
@@ -51,92 +51,120 @@ function $() {
|
|
|
51
51
|
e.wasConnected = !0;
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
(e.wasConnected ||
|
|
54
|
+
(e.wasConnected || o - e.trackedAt >= k) && (W(t), v.delete(i));
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
57
|
+
function U() {
|
|
58
|
+
if ($ || typeof setTimeout != "function") return;
|
|
59
|
+
$ = !0;
|
|
60
|
+
const o = () => {
|
|
61
|
+
if (V(), v.size === 0) {
|
|
62
|
+
$ = !1;
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
setTimeout(
|
|
65
|
+
setTimeout(o, k);
|
|
66
66
|
};
|
|
67
|
-
setTimeout(
|
|
67
|
+
setTimeout(o, k);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function N() {
|
|
70
70
|
if (P || typeof document > "u" || !document.documentElement || typeof MutationObserver > "u")
|
|
71
71
|
return;
|
|
72
72
|
new MutationObserver(() => {
|
|
73
|
-
|
|
73
|
+
V();
|
|
74
74
|
}).observe(document.documentElement, { childList: !0, subtree: !0 }), P = !0;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
const t = u.get(
|
|
79
|
-
return t.add(i), u.set(
|
|
76
|
+
function j(o, i) {
|
|
77
|
+
N(), U();
|
|
78
|
+
const t = u.get(o) ?? /* @__PURE__ */ new Set(), e = t.size > 0;
|
|
79
|
+
return t.add(i), u.set(o, t), e || (M.set(o, {
|
|
80
80
|
trackedAt: Date.now(),
|
|
81
|
-
wasConnected:
|
|
82
|
-
}), v.add(new WeakRef(
|
|
83
|
-
const n = u.get(
|
|
84
|
-
n && (n.delete(i), n.size === 0 && (u.delete(
|
|
81
|
+
wasConnected: o.isConnected
|
|
82
|
+
}), v.add(new WeakRef(o))), () => {
|
|
83
|
+
const n = u.get(o);
|
|
84
|
+
n && (n.delete(i), n.size === 0 && (u.delete(o), M.delete(o)));
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
element:
|
|
87
|
+
function K({
|
|
88
|
+
element: o,
|
|
89
89
|
accessor: i,
|
|
90
90
|
updater: t,
|
|
91
91
|
updaterId: e
|
|
92
92
|
}) {
|
|
93
|
-
const n = L.get(
|
|
94
|
-
L.has(
|
|
93
|
+
const n = L.get(o) ?? /* @__PURE__ */ new Map();
|
|
94
|
+
L.has(o) || L.set(o, n);
|
|
95
95
|
let r = n.get(i);
|
|
96
96
|
if (!r) {
|
|
97
97
|
const a = /* @__PURE__ */ new Map();
|
|
98
|
-
r = { effect:
|
|
98
|
+
r = { effect: S(() => {
|
|
99
99
|
const c = i();
|
|
100
100
|
a.forEach(
|
|
101
|
-
(w, h) =>
|
|
101
|
+
(w, h) => I(w, c, h)
|
|
102
102
|
);
|
|
103
103
|
}), updaters: a }, n.set(i, r);
|
|
104
104
|
}
|
|
105
|
-
r.updaters.set(e, t),
|
|
106
|
-
let
|
|
105
|
+
r.updaters.set(e, t), I(t, i(), e);
|
|
106
|
+
let s = null;
|
|
107
107
|
const l = () => {
|
|
108
|
-
|
|
109
|
-
const a = L.get(
|
|
110
|
-
d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) &&
|
|
108
|
+
s && (s(), s = null);
|
|
109
|
+
const a = L.get(o), d = a?.get(i);
|
|
110
|
+
d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) && D(i)), a && a.size === 0 && L.delete(o));
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
z() ? F(l) : s = j(o, l);
|
|
113
113
|
}
|
|
114
|
-
var
|
|
115
|
-
const
|
|
116
|
-
let
|
|
117
|
-
function
|
|
118
|
-
|
|
114
|
+
var x = Object.defineProperty, Y = (o, i, t) => i in o ? x(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t, f = (o, i, t) => Y(o, typeof i != "symbol" ? i + "" : i, t);
|
|
115
|
+
const H = Symbol.for("tachui.modifier.instanceId"), G = "core";
|
|
116
|
+
let R = 0;
|
|
117
|
+
function T(o) {
|
|
118
|
+
return typeof HTMLElement < "u" && o instanceof HTMLElement;
|
|
119
|
+
}
|
|
120
|
+
function A(o) {
|
|
121
|
+
return typeof o == "object" && o !== null && "style" in o && !!o.style;
|
|
122
|
+
}
|
|
123
|
+
function X(o) {
|
|
124
|
+
const i = o[H];
|
|
119
125
|
if (typeof i == "number") return i;
|
|
120
|
-
|
|
121
|
-
const t =
|
|
122
|
-
return Object.defineProperty(
|
|
126
|
+
R += 1;
|
|
127
|
+
const t = R;
|
|
128
|
+
return Object.defineProperty(o, H, {
|
|
123
129
|
value: t,
|
|
124
130
|
enumerable: !1,
|
|
125
131
|
configurable: !1,
|
|
126
132
|
writable: !1
|
|
127
133
|
}), t;
|
|
128
134
|
}
|
|
135
|
+
function Z(o, i, t) {
|
|
136
|
+
const e = [];
|
|
137
|
+
if (i.transition) {
|
|
138
|
+
const r = i.transition, s = r.property || "all", l = r.duration || 300, a = r.easing || "ease", d = r.delay || 0;
|
|
139
|
+
s === "none" ? e.push(`${o} { transition: none; }`) : e.push(
|
|
140
|
+
`${o} { transition: ${s} ${l}ms ${a} ${d}ms; }`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const n = i.animation;
|
|
144
|
+
if (n?.keyframes) {
|
|
145
|
+
const s = `tachui-animation-${o.replace(/[^a-zA-Z0-9_-]/g, "") || "component"}`;
|
|
146
|
+
e.push(t(s, n.keyframes));
|
|
147
|
+
const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1, c = n.direction || "normal";
|
|
148
|
+
e.push(
|
|
149
|
+
`${o} { animation: ${s} ${l}ms ${a} ${d} ${c}; }`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
return e;
|
|
153
|
+
}
|
|
129
154
|
class E {
|
|
130
155
|
constructor(i) {
|
|
131
156
|
this.properties = i;
|
|
132
157
|
}
|
|
158
|
+
getStaticCSS(i) {
|
|
159
|
+
return [];
|
|
160
|
+
}
|
|
133
161
|
/**
|
|
134
162
|
* Helper to resolve reactive properties
|
|
135
163
|
*/
|
|
136
164
|
resolveReactiveProps(i, t) {
|
|
137
165
|
const e = {};
|
|
138
166
|
for (const [n, r] of Object.entries(i))
|
|
139
|
-
|
|
167
|
+
b(r) || m(r), e[n] = r;
|
|
140
168
|
return e;
|
|
141
169
|
}
|
|
142
170
|
/**
|
|
@@ -146,16 +174,16 @@ class E {
|
|
|
146
174
|
const n = typeof HTMLElement < "u" && i instanceof HTMLElement;
|
|
147
175
|
if (!n && !i.style)
|
|
148
176
|
return;
|
|
149
|
-
const r = this.toCSSProperty(t),
|
|
177
|
+
const r = this.toCSSProperty(t), s = i.style, l = (a) => {
|
|
150
178
|
if (a.includes("!important")) {
|
|
151
179
|
const d = a.replace(/\s*!important\s*$/, "").trim();
|
|
152
|
-
|
|
180
|
+
s.setProperty(r, d, "important");
|
|
153
181
|
return;
|
|
154
182
|
}
|
|
155
|
-
|
|
183
|
+
s.setProperty(r, a);
|
|
156
184
|
};
|
|
157
|
-
if (
|
|
158
|
-
|
|
185
|
+
if (b(e) || m(e)) {
|
|
186
|
+
S(() => {
|
|
159
187
|
const a = e();
|
|
160
188
|
l(String(a));
|
|
161
189
|
});
|
|
@@ -209,25 +237,25 @@ class E {
|
|
|
209
237
|
applyStyles(i, t) {
|
|
210
238
|
const e = typeof HTMLElement < "u" && i instanceof HTMLElement;
|
|
211
239
|
if (e || i.style) {
|
|
212
|
-
const n = i.style, r = (
|
|
240
|
+
const n = i.style, r = (s, l) => {
|
|
213
241
|
if (n.setProperty)
|
|
214
242
|
if (typeof l == "string" && l.includes("!important")) {
|
|
215
243
|
const a = l.replace(/\s*!important\s*$/, "").trim();
|
|
216
|
-
n.setProperty(
|
|
244
|
+
n.setProperty(s, a, "important");
|
|
217
245
|
} else
|
|
218
|
-
n.setProperty(
|
|
246
|
+
n.setProperty(s, l);
|
|
219
247
|
else
|
|
220
|
-
n[
|
|
248
|
+
n[s] = l;
|
|
221
249
|
};
|
|
222
|
-
for (const [
|
|
250
|
+
for (const [s, l] of Object.entries(t))
|
|
223
251
|
if (l !== void 0) {
|
|
224
|
-
const a = this.toCSSProperty(
|
|
225
|
-
if (
|
|
226
|
-
const d = l, c =
|
|
227
|
-
|
|
252
|
+
const a = this.toCSSProperty(s);
|
|
253
|
+
if (b(l) || m(l)) {
|
|
254
|
+
const d = l, c = X(this);
|
|
255
|
+
K({
|
|
228
256
|
element: i,
|
|
229
257
|
accessor: d,
|
|
230
|
-
updaterId: `${
|
|
258
|
+
updaterId: `${G}:${c}:${a}`,
|
|
231
259
|
updater: (w) => {
|
|
232
260
|
const h = this.toCSSValueForProperty(a, w);
|
|
233
261
|
r(a, h);
|
|
@@ -244,13 +272,13 @@ class E {
|
|
|
244
272
|
* Add CSS classes to an element
|
|
245
273
|
*/
|
|
246
274
|
addClasses(i, t) {
|
|
247
|
-
i
|
|
275
|
+
T(i) && i.classList.add(...t);
|
|
248
276
|
}
|
|
249
277
|
/**
|
|
250
278
|
* Remove CSS classes from an element
|
|
251
279
|
*/
|
|
252
280
|
removeClasses(i, t) {
|
|
253
|
-
i
|
|
281
|
+
T(i) && i.classList.remove(...t);
|
|
254
282
|
}
|
|
255
283
|
/**
|
|
256
284
|
* Create a style computation context
|
|
@@ -265,7 +293,7 @@ class E {
|
|
|
265
293
|
};
|
|
266
294
|
}
|
|
267
295
|
}
|
|
268
|
-
class
|
|
296
|
+
class oe extends E {
|
|
269
297
|
constructor() {
|
|
270
298
|
super(...arguments), f(this, "type", "layout"), f(this, "priority", C.LAYOUT);
|
|
271
299
|
}
|
|
@@ -281,40 +309,40 @@ class ie extends E {
|
|
|
281
309
|
);
|
|
282
310
|
this.applyStyles(t.element, n);
|
|
283
311
|
const r = this.properties;
|
|
284
|
-
r.position && t.element
|
|
312
|
+
r.position && T(t.element) && this.applyAbsolutePosition(t.element, r.position);
|
|
285
313
|
}
|
|
286
314
|
// Layout modifier implementations have been migrated to @tachui/modifiers/layout
|
|
287
315
|
applyAbsolutePosition(i, t) {
|
|
288
|
-
const { x: e, y: n } = t, r = e ?? "auto",
|
|
289
|
-
i.style.left = this.toCSSValue(r), i.style.top = this.toCSSValue(
|
|
316
|
+
const { x: e, y: n } = t, r = e ?? "auto", s = n ?? "auto";
|
|
317
|
+
i.style.left = this.toCSSValue(r), i.style.top = this.toCSSValue(s);
|
|
290
318
|
}
|
|
291
319
|
computeLayoutStyles(i, t) {
|
|
292
320
|
const e = {};
|
|
293
321
|
if (i.frame) {
|
|
294
|
-
const n = i.frame, r =
|
|
322
|
+
const n = i.frame, r = _(n);
|
|
295
323
|
if (Object.assign(e, r.cssProps), n.width !== void 0) {
|
|
296
|
-
const
|
|
297
|
-
|
|
324
|
+
const s = g(n.width);
|
|
325
|
+
s !== void 0 && !p(n.width) && !r.expandWidth && (e.width = s);
|
|
298
326
|
}
|
|
299
327
|
if (n.height !== void 0) {
|
|
300
|
-
const
|
|
301
|
-
|
|
328
|
+
const s = g(n.height);
|
|
329
|
+
s !== void 0 && !p(n.height) && !r.expandHeight && (e.height = s);
|
|
302
330
|
}
|
|
303
331
|
if (n.minWidth !== void 0) {
|
|
304
|
-
const
|
|
305
|
-
|
|
332
|
+
const s = g(n.minWidth);
|
|
333
|
+
s !== void 0 && (e.minWidth = s);
|
|
306
334
|
}
|
|
307
335
|
if (n.maxWidth !== void 0 && !p(n.maxWidth)) {
|
|
308
|
-
const
|
|
309
|
-
|
|
336
|
+
const s = g(n.maxWidth);
|
|
337
|
+
s !== void 0 && (e.maxWidth = s);
|
|
310
338
|
} else p(n.maxWidth) && (e.maxWidth = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
|
|
311
339
|
if (n.minHeight !== void 0) {
|
|
312
|
-
const
|
|
313
|
-
|
|
340
|
+
const s = g(n.minHeight);
|
|
341
|
+
s !== void 0 && (e.minHeight = s);
|
|
314
342
|
}
|
|
315
343
|
if (n.maxHeight !== void 0 && !p(n.maxHeight)) {
|
|
316
|
-
const
|
|
317
|
-
|
|
344
|
+
const s = g(n.maxHeight);
|
|
345
|
+
s !== void 0 && (e.maxHeight = s);
|
|
318
346
|
} else p(n.maxHeight) && (e.maxHeight = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
|
|
319
347
|
}
|
|
320
348
|
if (i.padding !== void 0)
|
|
@@ -351,7 +379,7 @@ class ie extends E {
|
|
|
351
379
|
}
|
|
352
380
|
if (i.layoutPriority !== void 0) {
|
|
353
381
|
const n = Number(i.layoutPriority);
|
|
354
|
-
n > 0 ? (e.flexShrink = "0", e.flexGrow = String(Math.max(1, n / 10)), e.zIndex = String(n), e.gridRowEnd = `span ${String(Math.min(10, Math.max(1, Math.ceil(n / 10))))}`, e.gridColumnEnd = `span ${String(Math.min(10, Math.max(1, Math.ceil(n / 10))))}`) : n === 0 ? (e.flexShrink = "1", e.flexGrow = "1") : (e.flexShrink = String(Math.abs(n)), e.flexGrow = "0", e.zIndex = String(n)), e
|
|
382
|
+
n > 0 ? (e.flexShrink = "0", e.flexGrow = String(Math.max(1, n / 10)), e.zIndex = String(n), e.gridRowEnd = `span ${String(Math.min(10, Math.max(1, Math.ceil(n / 10))))}`, e.gridColumnEnd = `span ${String(Math.min(10, Math.max(1, Math.ceil(n / 10))))}`) : n === 0 ? (e.flexShrink = "1", e.flexGrow = "1") : (e.flexShrink = String(Math.abs(n)), e.flexGrow = "0", e.zIndex = String(n)), e["--layout-priority"] = String(n);
|
|
355
383
|
}
|
|
356
384
|
if (i.offset, i.aspectRatio) {
|
|
357
385
|
const { ratio: n, contentMode: r } = i.aspectRatio;
|
|
@@ -364,7 +392,7 @@ class ie extends E {
|
|
|
364
392
|
return e;
|
|
365
393
|
}
|
|
366
394
|
}
|
|
367
|
-
class
|
|
395
|
+
class se extends E {
|
|
368
396
|
constructor() {
|
|
369
397
|
super(...arguments), f(this, "type", "appearance"), f(this, "priority", C.APPEARANCE);
|
|
370
398
|
}
|
|
@@ -387,16 +415,16 @@ class ne extends E {
|
|
|
387
415
|
* Apply Asset-based styles with theme reactivity
|
|
388
416
|
*/
|
|
389
417
|
applyAssetBasedStyles(i, t) {
|
|
390
|
-
const e =
|
|
391
|
-
t.foregroundColor && this.isAsset(t.foregroundColor) &&
|
|
418
|
+
const e = B();
|
|
419
|
+
t.foregroundColor && this.isAsset(t.foregroundColor) && S(() => {
|
|
392
420
|
e();
|
|
393
421
|
const n = t.foregroundColor.resolve();
|
|
394
422
|
this.applyStyleChange(i, "color", n);
|
|
395
|
-
}), t.backgroundColor && this.isAsset(t.backgroundColor) &&
|
|
423
|
+
}), t.backgroundColor && this.isAsset(t.backgroundColor) && S(() => {
|
|
396
424
|
e();
|
|
397
425
|
const n = t.backgroundColor.resolve();
|
|
398
426
|
this.applyStyleChange(i, "backgroundColor", n);
|
|
399
|
-
}), t.border?.color && this.isAsset(t.border.color) &&
|
|
427
|
+
}), t.border?.color && this.isAsset(t.border.color) && S(() => {
|
|
400
428
|
e();
|
|
401
429
|
const n = t.border.color.resolve();
|
|
402
430
|
this.applyStyleChange(i, "borderColor", n);
|
|
@@ -418,7 +446,7 @@ class ne extends E {
|
|
|
418
446
|
t.fontFamily = r;
|
|
419
447
|
} else
|
|
420
448
|
t.fontFamily = n.family;
|
|
421
|
-
n.size !== void 0 && (t.fontSize =
|
|
449
|
+
n.size !== void 0 && (t.fontSize = b(n.size) || m(n.size) ? n.size : this.toCSSValue(n.size)), n.weight !== void 0 && (t.fontWeight = b(n.weight) || m(n.weight) ? n.weight : String(n.weight)), n.style && (t.fontStyle = n.style);
|
|
422
450
|
}
|
|
423
451
|
if (i.cornerRadius !== void 0 && (t.borderRadius = this.toCSSValue(i.cornerRadius)), i.border) {
|
|
424
452
|
const n = i.border;
|
|
@@ -451,7 +479,7 @@ class ne extends E {
|
|
|
451
479
|
return i._tachui_component || null;
|
|
452
480
|
}
|
|
453
481
|
}
|
|
454
|
-
class
|
|
482
|
+
class ae extends E {
|
|
455
483
|
constructor() {
|
|
456
484
|
super(...arguments), f(this, "type", "interaction"), f(this, "priority", C.INTERACTION);
|
|
457
485
|
}
|
|
@@ -470,15 +498,15 @@ class re extends E {
|
|
|
470
498
|
let n = 0, r = 0;
|
|
471
499
|
t.element.addEventListener(
|
|
472
500
|
"touchstart",
|
|
473
|
-
(
|
|
474
|
-
const a =
|
|
501
|
+
(s) => {
|
|
502
|
+
const a = s.touches[0];
|
|
475
503
|
n = a.clientX, r = a.clientY;
|
|
476
504
|
},
|
|
477
505
|
{ passive: !0 }
|
|
478
506
|
), t.element.addEventListener(
|
|
479
507
|
"touchend",
|
|
480
|
-
(
|
|
481
|
-
const a =
|
|
508
|
+
(s) => {
|
|
509
|
+
const a = s.changedTouches[0], d = a.clientX - n, c = a.clientY - r;
|
|
482
510
|
Math.abs(d) > Math.abs(c) && Math.abs(d) > 50 && (d < 0 && e.onSwipeLeft ? e.onSwipeLeft() : d > 0 && e.onSwipeRight && e.onSwipeRight());
|
|
483
511
|
},
|
|
484
512
|
{ passive: !0 }
|
|
@@ -489,12 +517,12 @@ class re extends E {
|
|
|
489
517
|
}), e.onWheel && t.element.addEventListener("wheel", e.onWheel, {
|
|
490
518
|
passive: !1
|
|
491
519
|
}), e.onInput && t.element.addEventListener("input", e.onInput), e.onChange && t.element.addEventListener("change", (n) => {
|
|
492
|
-
const r = n.target,
|
|
493
|
-
e.onChange(
|
|
494
|
-
}), e.onCopy && t.element.addEventListener("copy", e.onCopy), e.onCut && t.element.addEventListener("cut", e.onCut), e.onPaste && t.element.addEventListener("paste", e.onPaste), e.onSelect && t.element.addEventListener("select", e.onSelect), e.disabled !== void 0 && t.element
|
|
520
|
+
const r = n.target, s = r.value || r.textContent || "";
|
|
521
|
+
e.onChange(s, n);
|
|
522
|
+
}), e.onCopy && t.element.addEventListener("copy", e.onCopy), e.onCut && t.element.addEventListener("cut", e.onCut), e.onPaste && t.element.addEventListener("paste", e.onPaste), e.onSelect && t.element.addEventListener("select", e.onSelect), e.disabled !== void 0 && T(t.element) && (e.disabled ? (t.element.setAttribute("disabled", "true"), t.element.style.pointerEvents = "none", t.element.style.opacity = "0.6") : (t.element.removeAttribute("disabled"), t.element.style.pointerEvents = "", t.element.style.opacity = "")), e.draggable !== void 0 && T(t.element) && (t.element.draggable = e.draggable), e.accessibilityLabel && t.element.setAttribute("aria-label", e.accessibilityLabel), e.accessibilityHint && t.element.setAttribute("aria-describedby", e.accessibilityHint);
|
|
495
523
|
}
|
|
496
524
|
}
|
|
497
|
-
class
|
|
525
|
+
class le extends E {
|
|
498
526
|
constructor() {
|
|
499
527
|
super(...arguments), f(this, "type", "animation"), f(this, "priority", C.ANIMATION);
|
|
500
528
|
}
|
|
@@ -502,26 +530,26 @@ class oe extends E {
|
|
|
502
530
|
if (!t.element) return;
|
|
503
531
|
const e = this.properties;
|
|
504
532
|
if (e.transition) {
|
|
505
|
-
const n = e.transition, r = n.property || "all",
|
|
506
|
-
t.element
|
|
533
|
+
const n = e.transition, r = n.property || "all", s = n.duration || 300, l = n.easing || "ease", a = n.delay || 0;
|
|
534
|
+
A(t.element) && (r === "none" ? t.element.style.transition = "none" : t.element.style.transition = `${r} ${s}ms ${l} ${a}ms`);
|
|
507
535
|
}
|
|
508
|
-
if (e.animation && t.element
|
|
536
|
+
if (e.animation && A(t.element)) {
|
|
509
537
|
const n = e.animation;
|
|
510
|
-
if (n.keyframes) {
|
|
511
|
-
const r = `tachui-animation-${t.componentId}-${Date.now()}`,
|
|
538
|
+
if (n.keyframes && typeof document < "u") {
|
|
539
|
+
const r = `tachui-animation-${t.componentId}-${Date.now()}`, s = this.createKeyframeRule(
|
|
512
540
|
r,
|
|
513
541
|
n.keyframes
|
|
514
542
|
);
|
|
515
|
-
this.addKeyframesToStylesheet(
|
|
543
|
+
this.addKeyframesToStylesheet(s);
|
|
516
544
|
const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1, c = n.direction || "normal";
|
|
517
545
|
t.element.style.animation = `${r} ${l}ms ${a} ${d} ${c}`;
|
|
518
546
|
}
|
|
519
547
|
}
|
|
520
|
-
if (e.transform && t.element
|
|
548
|
+
if (e.transform && A(t.element) && (b(e.transform) || m(e.transform) ? S(() => {
|
|
521
549
|
const n = e.transform();
|
|
522
|
-
t.element
|
|
523
|
-
}) : t.element.style.transform = e.transform), e.scaleEffect && t.element
|
|
524
|
-
const { x: n, y: r, anchor:
|
|
550
|
+
A(t.element) && (t.element.style.transform = n);
|
|
551
|
+
}) : t.element.style.transform = e.transform), e.scaleEffect && A(t.element)) {
|
|
552
|
+
const { x: n, y: r, anchor: s } = e.scaleEffect, l = r ?? n, d = {
|
|
525
553
|
center: "50% 50%",
|
|
526
554
|
top: "50% 0%",
|
|
527
555
|
topLeading: "0% 0%",
|
|
@@ -531,20 +559,27 @@ class oe extends E {
|
|
|
531
559
|
bottomTrailing: "100% 100%",
|
|
532
560
|
leading: "0% 50%",
|
|
533
561
|
trailing: "100% 50%"
|
|
534
|
-
}[
|
|
562
|
+
}[s || "center"] || "50% 50%";
|
|
535
563
|
t.element.style.transformOrigin = d;
|
|
536
|
-
const c = `scale(${n}, ${l})`, h = (t.element.style.transform || "").replace(/\s*scale[XYZ3d]*\([^)]*\)\s*/g, " ").replace(/\s+/g, " ").trim(),
|
|
537
|
-
t.element.style.transform =
|
|
564
|
+
const c = `scale(${n}, ${l})`, h = (t.element.style.transform || "").replace(/\s*scale[XYZ3d]*\([^)]*\)\s*/g, " ").replace(/\s+/g, " ").trim(), O = h ? `${h} ${c}`.trim() : c;
|
|
565
|
+
t.element.style.transform = O;
|
|
538
566
|
}
|
|
539
567
|
}
|
|
568
|
+
getStaticCSS(i) {
|
|
569
|
+
return Z(
|
|
570
|
+
i,
|
|
571
|
+
this.properties,
|
|
572
|
+
this.createKeyframeRule.bind(this)
|
|
573
|
+
);
|
|
574
|
+
}
|
|
540
575
|
createKeyframeRule(i, t) {
|
|
541
576
|
let e = `@keyframes ${i} {
|
|
542
577
|
`;
|
|
543
578
|
for (const [n, r] of Object.entries(t)) {
|
|
544
579
|
e += ` ${n} {
|
|
545
580
|
`;
|
|
546
|
-
for (const [
|
|
547
|
-
const a = this.toCSSProperty(
|
|
581
|
+
for (const [s, l] of Object.entries(r)) {
|
|
582
|
+
const a = this.toCSSProperty(s);
|
|
548
583
|
e += ` ${a}: ${l};
|
|
549
584
|
`;
|
|
550
585
|
}
|
|
@@ -560,7 +595,7 @@ class oe extends E {
|
|
|
560
595
|
t || (t = document.createElement("style"), t.id = "tachui-animations", document.head.appendChild(t)), t.appendChild(document.createTextNode(i));
|
|
561
596
|
}
|
|
562
597
|
}
|
|
563
|
-
class
|
|
598
|
+
class de extends E {
|
|
564
599
|
constructor() {
|
|
565
600
|
super(...arguments), f(this, "type", "lifecycle"), f(this, "priority", C.CUSTOM), f(this, "activeAbortController");
|
|
566
601
|
}
|
|
@@ -601,7 +636,7 @@ class se extends E {
|
|
|
601
636
|
this.properties._cleanupFunctions || (this.properties._cleanupFunctions = []), this.properties._cleanupFunctions.push(i);
|
|
602
637
|
}
|
|
603
638
|
}
|
|
604
|
-
class
|
|
639
|
+
class fe extends E {
|
|
605
640
|
constructor() {
|
|
606
641
|
super(...arguments), f(this, "type", "resizable"), f(this, "priority", C.APPEARANCE);
|
|
607
642
|
}
|
|
@@ -610,13 +645,14 @@ class ae extends E {
|
|
|
610
645
|
}
|
|
611
646
|
}
|
|
612
647
|
export {
|
|
613
|
-
|
|
614
|
-
|
|
648
|
+
le as AnimationModifier,
|
|
649
|
+
se as AppearanceModifier,
|
|
615
650
|
E as BaseModifier,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
651
|
+
ae as InteractionModifier,
|
|
652
|
+
oe as LayoutModifier,
|
|
653
|
+
de as LifecycleModifier,
|
|
654
|
+
fe as ResizableModifier,
|
|
655
|
+
K as bindReactiveStyle,
|
|
656
|
+
Z as collectStaticAnimationCSSRules,
|
|
657
|
+
re as setReactiveStyleUpdaterErrorHandler
|
|
622
658
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@tachui/registry";
|
|
2
|
-
import { M as s, a, c as o, m as d, s as t } from "../concatenated-component-
|
|
2
|
+
import { M as s, a, c as o, m as d, s as t } from "../concatenated-component-DisxEqg6.js";
|
|
3
3
|
export {
|
|
4
4
|
s as ModifierBuilderImpl,
|
|
5
5
|
a as applyModifiers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../src/modifiers/factories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAElE,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EAEhB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../src/modifiers/factories.ts"],"names":[],"mappings":"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"}
|
package/dist/modifiers/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnimationModifier as r, AppearanceModifier as o, BaseModifier as a, InteractionModifier as s, LayoutModifier as f, LifecycleModifier as t, ResizableModifier as d } from "./base.js";
|
|
2
2
|
import { ModifierPriority as p } from "@tachui/types/modifiers";
|
|
3
|
-
import { M as c, a as l, b as m, d as y, c as x, e as b, m as u, s as g } from "../concatenated-component-
|
|
4
|
-
import { a as h, r as B } from "../proxy-
|
|
5
|
-
import { a as R, b as v, d as A, e as I, f as L, c as j, g as k, h as z, j as E, i as H, l as N, m as S, p as T, r as U, s as W, k as q } from "../factories-
|
|
3
|
+
import { M as c, a as l, b as m, d as y, c as x, e as b, m as u, s as g } from "../concatenated-component-DisxEqg6.js";
|
|
4
|
+
import { a as h, r as B } from "../proxy-B6FFddJq.js";
|
|
5
|
+
import { a as R, b as v, d as A, e as I, f as L, c as j, g as k, h as z, j as E, i as H, l as N, m as S, p as T, r as U, s as W, k as q } from "../factories-Bz6LZlk6.js";
|
|
6
6
|
import { r as D } from "../registration-utils-CNsN4eoU.js";
|
|
7
7
|
export {
|
|
8
8
|
r as AnimationModifier,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as a, d as r, e as s, z as t, B as d, A as p } from "../concatenated-component-
|
|
1
|
+
import { b as a, d as r, e as s, z as t, B as d, A as p } from "../concatenated-component-DisxEqg6.js";
|
|
2
2
|
import "@tachui/registry";
|
|
3
3
|
export {
|
|
4
4
|
a as applyModifiersToNode,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as l } from "./effect-DgNm6jk9.js";
|
|
2
2
|
import { d as f, j as p } from "./signal-BRoiFOO7.js";
|
|
3
|
-
import { d as a, g as d, p as g, c as y } from "./component-context-
|
|
3
|
+
import { d as a, g as d, p as g, c as y } from "./component-context-BB80qzyZ.js";
|
|
4
4
|
var j = Object.defineProperty, O = (e, t, n) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, s = (e, t, n) => O(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
5
|
class v {
|
|
6
6
|
constructor(t) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as v } from "./computed-CA4Cgtoe.js";
|
|
2
2
|
import { d as p } from "./signal-BRoiFOO7.js";
|
|
3
|
-
import { b as C } from "./component-context-
|
|
3
|
+
import { b as C } from "./component-context-BB80qzyZ.js";
|
|
4
4
|
var x = Object.defineProperty, b = (s, e, t) => e in s ? x(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, c = (s, e, t) => b(s, typeof e != "symbol" ? e + "" : e, t);
|
|
5
5
|
const f = class l {
|
|
6
6
|
constructor() {
|
|
@@ -18,6 +18,8 @@ export declare const EnvironmentSymbol: unique symbol;
|
|
|
18
18
|
* Create a new component context
|
|
19
19
|
*/
|
|
20
20
|
export declare function createComponentContext(componentId: string, parent?: ComponentContext): ComponentContext;
|
|
21
|
+
export declare function getCurrentComponentContextOrNull(): ComponentContext | null;
|
|
22
|
+
export declare function createDeterministicComponentId(componentName: string, parentContext?: ComponentContext): string;
|
|
21
23
|
/**
|
|
22
24
|
* Get the current component context
|
|
23
25
|
*/
|