@tachui/core 0.8.1-alpha → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -3
- package/dist/assets/AssetCollection.d.ts.map +1 -1
- package/dist/assets/ColorAsset.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 +486 -0
- package/dist/assets/types.d.ts +8 -68
- package/dist/assets/types.d.ts.map +1 -1
- package/dist/binding-DCV5PKkK.js +308 -0
- package/dist/build-plugins/index.d.ts +3 -0
- package/dist/build-plugins/index.d.ts.map +1 -0
- package/dist/build-plugins/modifier-types.d.ts +12 -0
- package/dist/build-plugins/modifier-types.d.ts.map +1 -0
- package/dist/build-tools/typegen-runner.d.ts +29 -0
- package/dist/build-tools/typegen-runner.d.ts.map +1 -0
- package/dist/bundles/minimal.d.ts +2 -0
- package/dist/bundles/minimal.d.ts.map +1 -1
- package/dist/common.js +427 -394
- package/dist/{component-XAzF1xqs.js → component-D-O9yq0P.js} +80 -68
- package/dist/{component-base-x2XmHFjy.js → component-base-C41K3NTe.js} +9 -7
- package/dist/component-context-B9HI2nZH.js +176 -0
- package/dist/components/factory.d.ts +24 -0
- package/dist/components/factory.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -6
- package/dist/components/wrapper.d.ts +70 -30
- package/dist/components/wrapper.d.ts.map +1 -1
- package/dist/concatenated-component-CP81AwgI.js +2288 -0
- package/dist/concatenation/concatenated-component.d.ts +16 -2
- package/dist/concatenation/concatenated-component.d.ts.map +1 -1
- package/dist/concatenation/text-optimizer.d.ts.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/constants/layout.d.ts +2 -9
- package/dist/constants/layout.d.ts.map +1 -1
- package/dist/css-classes/index.js +15 -173
- package/dist/{effect-B9Knft0b.js → effect-BsW3fy1q.js} +3 -3
- package/dist/enhanced-renderer-BXwg8n7F.js +172 -0
- package/dist/essential.js +427 -394
- package/dist/{index-DIvMCJQO.js → factories-B3-rmvkB.js} +13 -13
- package/dist/factory-BgnjJRGE.js +485 -0
- package/dist/gradients/css-generator.js +99 -0
- package/dist/gradients/index.js +56 -0
- package/dist/gradients/reactive.d.ts.map +1 -1
- package/dist/gradients/types.d.ts +3 -91
- package/dist/gradients/types.d.ts.map +1 -1
- package/dist/hooks-WGmpzYgD.js +446 -0
- package/dist/index-JQ1sW1SK.js +2049 -0
- package/dist/index-ykdS-3xs.js +618 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +427 -394
- package/dist/minimal-prod.js +100 -98
- package/dist/minimal.js +116 -109
- package/dist/modifiers/alignment.d.ts +5 -0
- package/dist/modifiers/alignment.d.ts.map +1 -0
- package/dist/modifiers/base.d.ts +7 -7
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +220 -92
- package/dist/modifiers/builder.d.ts +28 -165
- package/dist/modifiers/builder.d.ts.map +1 -1
- package/dist/modifiers/builder.js +7 -7
- package/dist/modifiers/core.d.ts +0 -1
- package/dist/modifiers/core.d.ts.map +1 -1
- package/dist/modifiers/corner-radius.d.ts +8 -0
- package/dist/modifiers/corner-radius.d.ts.map +1 -0
- package/dist/modifiers/index.d.ts +9 -6
- package/dist/modifiers/index.d.ts.map +1 -1
- package/dist/modifiers/index.js +36 -30
- package/dist/modifiers/layout-priority.d.ts +8 -0
- package/dist/modifiers/layout-priority.d.ts.map +1 -0
- package/dist/modifiers/opacity.d.ts +8 -0
- package/dist/modifiers/opacity.d.ts.map +1 -0
- package/dist/modifiers/presets.d.ts.map +1 -1
- package/dist/modifiers/proxy.d.ts +4 -0
- package/dist/modifiers/proxy.d.ts.map +1 -0
- package/dist/modifiers/reactive-style-bindings.d.ts +22 -0
- package/dist/modifiers/reactive-style-bindings.d.ts.map +1 -0
- package/dist/modifiers/registration-utils.d.ts +7 -0
- package/dist/modifiers/registration-utils.d.ts.map +1 -0
- package/dist/modifiers/registry.d.ts +18 -9
- package/dist/modifiers/registry.d.ts.map +1 -1
- package/dist/modifiers/registry.js +2 -2
- package/dist/modifiers/type-generator.d.ts +82 -0
- package/dist/modifiers/type-generator.d.ts.map +1 -0
- package/dist/modifiers/types.d.ts +2 -479
- package/dist/modifiers/types.d.ts.map +1 -1
- package/dist/modifiers/types.js +1 -4
- package/dist/{observed-object-Cos-FtjP.js → observed-object-p1CLdrFm.js} +3 -3
- package/dist/optimization-CbKNA9w4.js +21 -0
- package/dist/plugins/index.js +28 -8
- package/dist/plugins/simplified-lazy-loader.d.ts.map +1 -1
- package/dist/presets-B9x94uRn.js +381 -0
- package/dist/proxy-522Jjabr.js +188 -0
- package/dist/reactive/cleanup.d.ts.map +1 -1
- package/dist/reactive/computed.d.ts +4 -1
- package/dist/reactive/computed.d.ts.map +1 -1
- package/dist/reactive/context.d.ts +4 -3
- package/dist/reactive/context.d.ts.map +1 -1
- package/dist/reactive/index.d.ts +1 -0
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/index.js +84 -490
- package/dist/reactive/signal-list.d.ts +100 -0
- package/dist/reactive/signal-list.d.ts.map +1 -0
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive/types.d.ts +2 -89
- package/dist/reactive/types.d.ts.map +1 -1
- package/dist/reactive/types.js +1 -4
- package/dist/registration-utils-CNsN4eoU.js +27 -0
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/concatenation-aria.d.ts.map +1 -1
- package/dist/runtime/concatenation-aria.js +18 -13
- package/dist/runtime/concatenation-full.d.ts.map +1 -1
- package/dist/runtime/concatenation-full.js +42 -34
- package/dist/runtime/concatenation-minimal.d.ts.map +1 -1
- package/dist/runtime/concatenation-minimal.js +13 -8
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.d.ts +1 -1
- package/dist/runtime/dom-bridge.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.js +239 -12
- package/dist/runtime/event-delegation.d.ts +59 -0
- package/dist/runtime/event-delegation.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +96 -0
- package/dist/runtime/layout-scheduler.d.ts +89 -0
- package/dist/runtime/layout-scheduler.d.ts.map +1 -0
- package/dist/runtime/props.d.ts.map +1 -1
- package/dist/runtime/renderer.d.ts +54 -2
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +11 -7
- package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +2 -226
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js +1 -1
- package/dist/scheduler-DppMK9mR.js +169 -0
- package/dist/signal-list-07gNXGiW.js +525 -0
- package/dist/state/index.js +319 -0
- package/dist/theme-CRLPHryV.js +687 -0
- package/dist/utils/clone-helpers.d.ts +11 -0
- package/dist/utils/clone-helpers.d.ts.map +1 -0
- package/dist/validation/index.js +28 -26
- package/dist/version.d.ts +19 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/package.json +52 -11
- package/dist/concatenated-component-ByPl3_FF.js +0 -2933
- package/dist/dom-bridge-CAa1N2zX.js +0 -406
- package/dist/index-DEBd8cq7.js +0 -1144
- package/dist/index-vdsiw6gQ.js +0 -777
- package/dist/modifiers/as-html-validator.d.ts +0 -20
- package/dist/modifiers/as-html-validator.d.ts.map +0 -1
- package/dist/modifiers/as-html.d.ts +0 -65
- package/dist/modifiers/as-html.d.ts.map +0 -1
- package/dist/modifiers/background.d.ts +0 -51
- package/dist/modifiers/background.d.ts.map +0 -1
- package/dist/modifiers/basic-sanitizer.d.ts +0 -54
- package/dist/modifiers/basic-sanitizer.d.ts.map +0 -1
- package/dist/modifiers/css.d.ts +0 -86
- package/dist/modifiers/css.d.ts.map +0 -1
- package/dist/production-minimal-BY_gMc-l.js +0 -2532
- package/dist/scheduler-BKeqwrYE.js +0 -814
package/dist/modifiers/base.js
CHANGED
|
@@ -1,9 +1,131 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { o as R } from "../scheduler-DppMK9mR.js";
|
|
2
|
+
import { p as O, d as m, r as D, i as v, K as B } from "../theme-CRLPHryV.js";
|
|
3
|
+
import { c as b } from "../effect-BsW3fy1q.js";
|
|
4
|
+
import "@tachui/types/reactive";
|
|
5
|
+
import { ModifierPriority as S } from "@tachui/types/modifiers";
|
|
6
|
+
import { shouldExpandForInfinity as _, dimensionToCSS as h, isInfinity as g } from "../constants/layout.js";
|
|
7
|
+
const w = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
let p = null;
|
|
9
|
+
function ee(s) {
|
|
10
|
+
if (s === null)
|
|
11
|
+
return p = null, () => {
|
|
12
|
+
};
|
|
13
|
+
const i = p;
|
|
14
|
+
return p = (t, e) => {
|
|
15
|
+
i?.(t, e), s(t, e);
|
|
16
|
+
}, () => {
|
|
17
|
+
p = i;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function k(s, i, t) {
|
|
21
|
+
try {
|
|
22
|
+
s(i);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
if (p) {
|
|
25
|
+
p(e, { updaterId: t, value: i });
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
console.error(`Reactive style updater failed (${t}):`, e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const M = 200, u = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Set();
|
|
32
|
+
let P = !1, A = !1;
|
|
33
|
+
function z(s) {
|
|
34
|
+
u.get(s)?.forEach((t) => t()), u.delete(s), T.delete(s);
|
|
35
|
+
}
|
|
36
|
+
function H() {
|
|
37
|
+
const s = Date.now();
|
|
38
|
+
for (const i of Array.from(y)) {
|
|
39
|
+
const t = i.deref();
|
|
40
|
+
if (!t) {
|
|
41
|
+
y.delete(i);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const e = T.get(t), n = u.get(t);
|
|
45
|
+
if (!e || !n || n.size === 0) {
|
|
46
|
+
y.delete(i);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (t.isConnected) {
|
|
50
|
+
e.wasConnected = !0;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
(e.wasConnected || s - e.trackedAt >= M) && (z(t), y.delete(i));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function F() {
|
|
57
|
+
if (A || typeof setTimeout != "function") return;
|
|
58
|
+
A = !0;
|
|
59
|
+
const s = () => {
|
|
60
|
+
if (H(), y.size === 0) {
|
|
61
|
+
A = !1;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setTimeout(s, M);
|
|
65
|
+
};
|
|
66
|
+
setTimeout(s, M);
|
|
67
|
+
}
|
|
68
|
+
function W() {
|
|
69
|
+
if (P || typeof document > "u" || !document.documentElement || typeof MutationObserver > "u")
|
|
70
|
+
return;
|
|
71
|
+
new MutationObserver(() => {
|
|
72
|
+
H();
|
|
73
|
+
}).observe(document.documentElement, { childList: !0, subtree: !0 }), P = !0;
|
|
74
|
+
}
|
|
75
|
+
function U(s, i) {
|
|
76
|
+
W(), F();
|
|
77
|
+
const t = u.get(s) ?? /* @__PURE__ */ new Set(), e = t.size > 0;
|
|
78
|
+
return t.add(i), u.set(s, t), e || (T.set(s, {
|
|
79
|
+
trackedAt: Date.now(),
|
|
80
|
+
wasConnected: s.isConnected
|
|
81
|
+
}), y.add(new WeakRef(s))), () => {
|
|
82
|
+
const n = u.get(s);
|
|
83
|
+
n && (n.delete(i), n.size === 0 && (u.delete(s), T.delete(s)));
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function N({
|
|
87
|
+
element: s,
|
|
88
|
+
accessor: i,
|
|
89
|
+
updater: t,
|
|
90
|
+
updaterId: e
|
|
91
|
+
}) {
|
|
92
|
+
const n = w.get(s) ?? /* @__PURE__ */ new Map();
|
|
93
|
+
w.has(s) || w.set(s, n);
|
|
94
|
+
let r = n.get(i);
|
|
95
|
+
if (!r) {
|
|
96
|
+
const a = /* @__PURE__ */ new Map();
|
|
97
|
+
r = { effect: b(() => {
|
|
98
|
+
const c = i();
|
|
99
|
+
a.forEach(
|
|
100
|
+
(E, L) => k(E, c, L)
|
|
101
|
+
);
|
|
102
|
+
}), updaters: a }, n.set(i, r);
|
|
103
|
+
}
|
|
104
|
+
r.updaters.set(e, t), k(t, i(), e);
|
|
105
|
+
let o = null;
|
|
106
|
+
const l = () => {
|
|
107
|
+
o && (o(), o = null);
|
|
108
|
+
const a = w.get(s), d = a?.get(i);
|
|
109
|
+
d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) && D(i)), a && a.size === 0 && w.delete(s));
|
|
110
|
+
};
|
|
111
|
+
O() ? R(l) : o = U(s, l);
|
|
112
|
+
}
|
|
113
|
+
var j = Object.defineProperty, K = (s, i, t) => i in s ? j(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t, f = (s, i, t) => K(s, typeof i != "symbol" ? i + "" : i, t);
|
|
114
|
+
const I = Symbol.for("tachui.modifier.instanceId"), x = "core";
|
|
115
|
+
let $ = 0;
|
|
116
|
+
function Y(s) {
|
|
117
|
+
const i = s[I];
|
|
118
|
+
if (typeof i == "number") return i;
|
|
119
|
+
$ += 1;
|
|
120
|
+
const t = $;
|
|
121
|
+
return Object.defineProperty(s, I, {
|
|
122
|
+
value: t,
|
|
123
|
+
enumerable: !1,
|
|
124
|
+
configurable: !1,
|
|
125
|
+
writable: !1
|
|
126
|
+
}), t;
|
|
127
|
+
}
|
|
128
|
+
class C {
|
|
7
129
|
constructor(i) {
|
|
8
130
|
this.properties = i;
|
|
9
131
|
}
|
|
@@ -13,7 +135,7 @@ class y {
|
|
|
13
135
|
resolveReactiveProps(i, t) {
|
|
14
136
|
const e = {};
|
|
15
137
|
for (const [n, r] of Object.entries(i))
|
|
16
|
-
|
|
138
|
+
v(r) || m(r), e[n] = r;
|
|
17
139
|
return e;
|
|
18
140
|
}
|
|
19
141
|
/**
|
|
@@ -22,12 +144,12 @@ class y {
|
|
|
22
144
|
applyStyleChange(i, t, e) {
|
|
23
145
|
if (i instanceof HTMLElement) {
|
|
24
146
|
const n = this.toCSSProperty(t);
|
|
25
|
-
if (
|
|
26
|
-
|
|
147
|
+
if (v(e) || m(e))
|
|
148
|
+
b(() => {
|
|
27
149
|
const r = e(), o = String(r);
|
|
28
150
|
if (o.includes("!important")) {
|
|
29
|
-
const
|
|
30
|
-
i.style.setProperty(n,
|
|
151
|
+
const l = o.replace(/\s*!important\s*$/, "").trim();
|
|
152
|
+
i.style.setProperty(n, l, "important");
|
|
31
153
|
} else
|
|
32
154
|
i.style.setProperty(n, o);
|
|
33
155
|
});
|
|
@@ -80,35 +202,33 @@ class y {
|
|
|
80
202
|
*/
|
|
81
203
|
applyStyles(i, t) {
|
|
82
204
|
if (i instanceof HTMLElement || i.style) {
|
|
83
|
-
const e = (i instanceof HTMLElement, i.style)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
205
|
+
const e = (i instanceof HTMLElement, i.style), n = (r, o) => {
|
|
206
|
+
if (e.setProperty)
|
|
207
|
+
if (typeof o == "string" && o.includes("!important")) {
|
|
208
|
+
const l = o.replace(/\s*!important\s*$/, "").trim();
|
|
209
|
+
e.setProperty(r, l, "important");
|
|
210
|
+
} else
|
|
211
|
+
e.setProperty(r, o);
|
|
212
|
+
else
|
|
213
|
+
e[r] = o;
|
|
214
|
+
};
|
|
215
|
+
for (const [r, o] of Object.entries(t))
|
|
216
|
+
if (o !== void 0) {
|
|
217
|
+
const l = this.toCSSProperty(r);
|
|
218
|
+
if (v(o) || m(o)) {
|
|
219
|
+
const a = o, d = Y(this);
|
|
220
|
+
N({
|
|
221
|
+
element: i,
|
|
222
|
+
accessor: a,
|
|
223
|
+
updaterId: `${x}:${d}:${l}`,
|
|
224
|
+
updater: (c) => {
|
|
225
|
+
const E = this.toCSSValueForProperty(l, c);
|
|
226
|
+
n(l, E);
|
|
227
|
+
}
|
|
101
228
|
});
|
|
102
|
-
else {
|
|
103
|
-
const a = this.toCSSValueForProperty(
|
|
104
|
-
|
|
105
|
-
if (typeof a == "string" && a.includes("!important")) {
|
|
106
|
-
const s = a.replace(/\s*!important\s*$/, "").trim();
|
|
107
|
-
e.setProperty(o, s, "important");
|
|
108
|
-
} else
|
|
109
|
-
e.setProperty(o, a);
|
|
110
|
-
else
|
|
111
|
-
e[o] = a;
|
|
229
|
+
} else {
|
|
230
|
+
const a = this.toCSSValueForProperty(l, o);
|
|
231
|
+
n(l, a);
|
|
112
232
|
}
|
|
113
233
|
}
|
|
114
234
|
}
|
|
@@ -138,9 +258,9 @@ class y {
|
|
|
138
258
|
};
|
|
139
259
|
}
|
|
140
260
|
}
|
|
141
|
-
class
|
|
261
|
+
class te extends C {
|
|
142
262
|
constructor() {
|
|
143
|
-
super(...arguments),
|
|
263
|
+
super(...arguments), f(this, "type", "layout"), f(this, "priority", S.LAYOUT);
|
|
144
264
|
}
|
|
145
265
|
apply(i, t) {
|
|
146
266
|
if (!i.element || !t.element) return;
|
|
@@ -164,31 +284,31 @@ class k extends y {
|
|
|
164
284
|
computeLayoutStyles(i, t) {
|
|
165
285
|
const e = {};
|
|
166
286
|
if (i.frame) {
|
|
167
|
-
const n = i.frame, r =
|
|
287
|
+
const n = i.frame, r = _(n);
|
|
168
288
|
if (Object.assign(e, r.cssProps), n.width !== void 0) {
|
|
169
|
-
const o =
|
|
170
|
-
o !== void 0 && !
|
|
289
|
+
const o = h(n.width);
|
|
290
|
+
o !== void 0 && !g(n.width) && !r.expandWidth && (e.width = o);
|
|
171
291
|
}
|
|
172
292
|
if (n.height !== void 0) {
|
|
173
|
-
const o =
|
|
174
|
-
o !== void 0 && !
|
|
293
|
+
const o = h(n.height);
|
|
294
|
+
o !== void 0 && !g(n.height) && !r.expandHeight && (e.height = o);
|
|
175
295
|
}
|
|
176
296
|
if (n.minWidth !== void 0) {
|
|
177
|
-
const o =
|
|
297
|
+
const o = h(n.minWidth);
|
|
178
298
|
o !== void 0 && (e.minWidth = o);
|
|
179
299
|
}
|
|
180
|
-
if (n.maxWidth !== void 0 && !
|
|
181
|
-
const o =
|
|
300
|
+
if (n.maxWidth !== void 0 && !g(n.maxWidth)) {
|
|
301
|
+
const o = h(n.maxWidth);
|
|
182
302
|
o !== void 0 && (e.maxWidth = o);
|
|
183
|
-
} else
|
|
303
|
+
} else g(n.maxWidth) && (e.maxWidth = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
|
|
184
304
|
if (n.minHeight !== void 0) {
|
|
185
|
-
const o =
|
|
305
|
+
const o = h(n.minHeight);
|
|
186
306
|
o !== void 0 && (e.minHeight = o);
|
|
187
307
|
}
|
|
188
|
-
if (n.maxHeight !== void 0 && !
|
|
189
|
-
const o =
|
|
308
|
+
if (n.maxHeight !== void 0 && !g(n.maxHeight)) {
|
|
309
|
+
const o = h(n.maxHeight);
|
|
190
310
|
o !== void 0 && (e.maxHeight = o);
|
|
191
|
-
} else
|
|
311
|
+
} else g(n.maxHeight) && (e.maxHeight = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
|
|
192
312
|
}
|
|
193
313
|
if (i.padding !== void 0)
|
|
194
314
|
if (typeof i.padding == "number")
|
|
@@ -237,9 +357,9 @@ class k extends y {
|
|
|
237
357
|
return e;
|
|
238
358
|
}
|
|
239
359
|
}
|
|
240
|
-
class
|
|
360
|
+
class ie extends C {
|
|
241
361
|
constructor() {
|
|
242
|
-
super(...arguments),
|
|
362
|
+
super(...arguments), f(this, "type", "appearance"), f(this, "priority", S.APPEARANCE);
|
|
243
363
|
}
|
|
244
364
|
apply(i, t) {
|
|
245
365
|
if (!i.element || !t.element)
|
|
@@ -260,16 +380,16 @@ class $ extends y {
|
|
|
260
380
|
* Apply Asset-based styles with theme reactivity
|
|
261
381
|
*/
|
|
262
382
|
applyAssetBasedStyles(i, t) {
|
|
263
|
-
const e =
|
|
264
|
-
t.foregroundColor && this.isAsset(t.foregroundColor) &&
|
|
383
|
+
const e = B();
|
|
384
|
+
t.foregroundColor && this.isAsset(t.foregroundColor) && b(() => {
|
|
265
385
|
e();
|
|
266
386
|
const n = t.foregroundColor.resolve();
|
|
267
387
|
this.applyStyleChange(i, "color", n);
|
|
268
|
-
}), t.backgroundColor && this.isAsset(t.backgroundColor) &&
|
|
388
|
+
}), t.backgroundColor && this.isAsset(t.backgroundColor) && b(() => {
|
|
269
389
|
e();
|
|
270
390
|
const n = t.backgroundColor.resolve();
|
|
271
391
|
this.applyStyleChange(i, "backgroundColor", n);
|
|
272
|
-
}), t.border?.color && this.isAsset(t.border.color) &&
|
|
392
|
+
}), t.border?.color && this.isAsset(t.border.color) && b(() => {
|
|
273
393
|
e();
|
|
274
394
|
const n = t.border.color.resolve();
|
|
275
395
|
this.applyStyleChange(i, "borderColor", n);
|
|
@@ -285,7 +405,13 @@ class $ extends y {
|
|
|
285
405
|
const t = {};
|
|
286
406
|
if (i.foregroundColor && !this.isAsset(i.foregroundColor) && (t.color = i.foregroundColor), i.backgroundColor && !this.isAsset(i.backgroundColor) && (t.backgroundColor = i.backgroundColor), i.opacity !== void 0 && (t.opacity = i.opacity), i.font) {
|
|
287
407
|
const n = i.font;
|
|
288
|
-
|
|
408
|
+
if (n.family)
|
|
409
|
+
if (typeof n.family == "object" && n.family !== null && typeof n.family.resolve == "function") {
|
|
410
|
+
const r = n.family.resolve();
|
|
411
|
+
t.fontFamily = r;
|
|
412
|
+
} else
|
|
413
|
+
t.fontFamily = n.family;
|
|
414
|
+
n.size !== void 0 && (t.fontSize = v(n.size) || m(n.size) ? n.size : this.toCSSValue(n.size)), n.weight !== void 0 && (t.fontWeight = v(n.weight) || m(n.weight) ? n.weight : String(n.weight)), n.style && (t.fontStyle = n.style);
|
|
289
415
|
}
|
|
290
416
|
if (i.cornerRadius !== void 0 && (t.borderRadius = this.toCSSValue(i.cornerRadius)), i.border) {
|
|
291
417
|
const n = i.border;
|
|
@@ -318,9 +444,9 @@ class $ extends y {
|
|
|
318
444
|
return i._tachui_component || null;
|
|
319
445
|
}
|
|
320
446
|
}
|
|
321
|
-
class
|
|
447
|
+
class ne extends C {
|
|
322
448
|
constructor() {
|
|
323
|
-
super(...arguments),
|
|
449
|
+
super(...arguments), f(this, "type", "interaction"), f(this, "priority", S.INTERACTION);
|
|
324
450
|
}
|
|
325
451
|
apply(i, t) {
|
|
326
452
|
if (!t.element) return;
|
|
@@ -338,15 +464,15 @@ class H extends y {
|
|
|
338
464
|
t.element.addEventListener(
|
|
339
465
|
"touchstart",
|
|
340
466
|
(o) => {
|
|
341
|
-
const
|
|
342
|
-
n =
|
|
467
|
+
const a = o.touches[0];
|
|
468
|
+
n = a.clientX, r = a.clientY;
|
|
343
469
|
},
|
|
344
470
|
{ passive: !0 }
|
|
345
471
|
), t.element.addEventListener(
|
|
346
472
|
"touchend",
|
|
347
473
|
(o) => {
|
|
348
|
-
const
|
|
349
|
-
Math.abs(
|
|
474
|
+
const a = o.changedTouches[0], d = a.clientX - n, c = a.clientY - r;
|
|
475
|
+
Math.abs(d) > Math.abs(c) && Math.abs(d) > 50 && (d < 0 && e.onSwipeLeft ? e.onSwipeLeft() : d > 0 && e.onSwipeRight && e.onSwipeRight());
|
|
350
476
|
},
|
|
351
477
|
{ passive: !0 }
|
|
352
478
|
);
|
|
@@ -361,16 +487,16 @@ class H extends y {
|
|
|
361
487
|
}), 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 instanceof HTMLElement && (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.element instanceof HTMLElement && (t.element.draggable = e.draggable), e.accessibilityLabel && t.element.setAttribute("aria-label", e.accessibilityLabel), e.accessibilityHint && t.element.setAttribute("aria-describedby", e.accessibilityHint);
|
|
362
488
|
}
|
|
363
489
|
}
|
|
364
|
-
class
|
|
490
|
+
class re extends C {
|
|
365
491
|
constructor() {
|
|
366
|
-
super(...arguments),
|
|
492
|
+
super(...arguments), f(this, "type", "animation"), f(this, "priority", S.ANIMATION);
|
|
367
493
|
}
|
|
368
494
|
apply(i, t) {
|
|
369
495
|
if (!t.element) return;
|
|
370
496
|
const e = this.properties;
|
|
371
497
|
if (e.transition) {
|
|
372
|
-
const n = e.transition, r = n.property || "all", o = n.duration || 300,
|
|
373
|
-
t.element instanceof HTMLElement && (t.element.style.transition = `${r} ${o}ms ${
|
|
498
|
+
const n = e.transition, r = n.property || "all", o = n.duration || 300, l = n.easing || "ease", a = n.delay || 0;
|
|
499
|
+
t.element instanceof HTMLElement && (t.element.style.transition = `${r} ${o}ms ${l} ${a}ms`);
|
|
374
500
|
}
|
|
375
501
|
if (e.animation && t.element instanceof HTMLElement) {
|
|
376
502
|
const n = e.animation;
|
|
@@ -380,15 +506,15 @@ class I extends y {
|
|
|
380
506
|
n.keyframes
|
|
381
507
|
);
|
|
382
508
|
this.addKeyframesToStylesheet(o);
|
|
383
|
-
const
|
|
384
|
-
t.element.style.animation = `${r} ${
|
|
509
|
+
const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1, c = n.direction || "normal";
|
|
510
|
+
t.element.style.animation = `${r} ${l}ms ${a} ${d} ${c}`;
|
|
385
511
|
}
|
|
386
512
|
}
|
|
387
|
-
if (e.transform && t.element instanceof HTMLElement && (
|
|
513
|
+
if (e.transform && t.element instanceof HTMLElement && (v(e.transform) || m(e.transform) ? b(() => {
|
|
388
514
|
const n = e.transform();
|
|
389
515
|
t.element instanceof HTMLElement && (t.element.style.transform = n);
|
|
390
516
|
}) : t.element.style.transform = e.transform), e.scaleEffect && t.element instanceof HTMLElement) {
|
|
391
|
-
const { x: n, y: r, anchor: o } = e.scaleEffect,
|
|
517
|
+
const { x: n, y: r, anchor: o } = e.scaleEffect, l = r ?? n, d = {
|
|
392
518
|
center: "50% 50%",
|
|
393
519
|
top: "50% 0%",
|
|
394
520
|
topLeading: "0% 0%",
|
|
@@ -399,9 +525,9 @@ class I extends y {
|
|
|
399
525
|
leading: "0% 50%",
|
|
400
526
|
trailing: "100% 50%"
|
|
401
527
|
}[o || "center"] || "50% 50%";
|
|
402
|
-
t.element.style.transformOrigin =
|
|
403
|
-
const c = `scale(${n}, ${
|
|
404
|
-
t.element.style.transform =
|
|
528
|
+
t.element.style.transformOrigin = d;
|
|
529
|
+
const c = `scale(${n}, ${l})`, L = (t.element.style.transform || "").replace(/\s*scale[XYZ3d]*\([^)]*\)\s*/g, " ").replace(/\s+/g, " ").trim(), V = L ? `${L} ${c}`.trim() : c;
|
|
530
|
+
t.element.style.transform = V;
|
|
405
531
|
}
|
|
406
532
|
}
|
|
407
533
|
createKeyframeRule(i, t) {
|
|
@@ -410,9 +536,9 @@ class I extends y {
|
|
|
410
536
|
for (const [n, r] of Object.entries(t)) {
|
|
411
537
|
e += ` ${n} {
|
|
412
538
|
`;
|
|
413
|
-
for (const [o,
|
|
414
|
-
const
|
|
415
|
-
e += ` ${
|
|
539
|
+
for (const [o, l] of Object.entries(r)) {
|
|
540
|
+
const a = this.toCSSProperty(o);
|
|
541
|
+
e += ` ${a}: ${l};
|
|
416
542
|
`;
|
|
417
543
|
}
|
|
418
544
|
e += ` }
|
|
@@ -427,9 +553,9 @@ class I extends y {
|
|
|
427
553
|
t || (t = document.createElement("style"), t.id = "tachui-animations", document.head.appendChild(t)), t.appendChild(document.createTextNode(i));
|
|
428
554
|
}
|
|
429
555
|
}
|
|
430
|
-
class
|
|
556
|
+
class oe extends C {
|
|
431
557
|
constructor() {
|
|
432
|
-
super(...arguments),
|
|
558
|
+
super(...arguments), f(this, "type", "lifecycle"), f(this, "priority", S.CUSTOM), f(this, "activeAbortController");
|
|
433
559
|
}
|
|
434
560
|
apply(i, t) {
|
|
435
561
|
if (!t.element) return;
|
|
@@ -468,20 +594,22 @@ class R extends y {
|
|
|
468
594
|
this.properties._cleanupFunctions || (this.properties._cleanupFunctions = []), this.properties._cleanupFunctions.push(i);
|
|
469
595
|
}
|
|
470
596
|
}
|
|
471
|
-
class
|
|
597
|
+
class se extends C {
|
|
472
598
|
constructor() {
|
|
473
|
-
super(...arguments),
|
|
599
|
+
super(...arguments), f(this, "type", "resizable"), f(this, "priority", S.APPEARANCE);
|
|
474
600
|
}
|
|
475
601
|
apply(i, t) {
|
|
476
602
|
t.element && t.element instanceof HTMLImageElement && (t.element.style.objectFit = "fill");
|
|
477
603
|
}
|
|
478
604
|
}
|
|
479
605
|
export {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
606
|
+
re as AnimationModifier,
|
|
607
|
+
ie as AppearanceModifier,
|
|
608
|
+
C as BaseModifier,
|
|
609
|
+
ne as InteractionModifier,
|
|
610
|
+
te as LayoutModifier,
|
|
611
|
+
oe as LifecycleModifier,
|
|
612
|
+
se as ResizableModifier,
|
|
613
|
+
N as bindReactiveStyle,
|
|
614
|
+
ee as setReactiveStyleUpdaterErrorHandler
|
|
487
615
|
};
|