@tachui/primitives 0.8.16 → 0.8.18
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/{ScrollView-CtvxVuuS.js → ScrollView-4WhOoZol.js} +258 -172
- package/dist/display/Image.d.ts +6 -0
- package/dist/display/Image.d.ts.map +1 -1
- package/dist/display/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/layout/Spacer.d.ts +3 -7
- package/dist/layout/Spacer.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,29 +1,73 @@
|
|
|
1
|
-
import { withModifiers as f, ComponentWithCSSClasses as
|
|
2
|
-
import { isSignal as
|
|
3
|
-
import { aspectRatio as
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
import { withModifiers as f, ComponentWithCSSClasses as V, processElementOverride as D, createSignal as w, useLifecycle as k, registerComponentWithLifecycleHooks as F, h as v, createEffect as y, ConcatenatedComponent as A, sanitizeSVG as N, text as Y, isSignal as b } from "@tachui/core";
|
|
2
|
+
import { isSignal as x, isComputed as z } from "@tachui/core/reactive";
|
|
3
|
+
import { aspectRatio as $ } from "@tachui/modifiers";
|
|
4
|
+
var B = Object.defineProperty, j = (e, t, s) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, m = (e, t, s) => j(e, typeof t != "symbol" ? t + "" : t, s);
|
|
5
|
+
const M = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map();
|
|
6
|
+
function H(e) {
|
|
6
7
|
return typeof e == "object" && e !== null && typeof e.resolve == "function";
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
return e && (
|
|
9
|
+
function G(e) {
|
|
10
|
+
return e && (H(e) ? e.resolve() : e);
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
function R(e) {
|
|
13
|
+
if (e !== void 0)
|
|
14
|
+
return x(e) || z(e) ? e() : e;
|
|
15
|
+
}
|
|
16
|
+
function X(e) {
|
|
17
|
+
if (e)
|
|
18
|
+
return H(e) ? e.resolve() : x(e) || z(e) ? e() : e;
|
|
19
|
+
}
|
|
20
|
+
function q(e) {
|
|
21
|
+
if (process.env.NODE_ENV === "production") return;
|
|
22
|
+
const t = [];
|
|
23
|
+
e.loadingStrategy !== void 0 && t.push("loadingStrategy"), e.decoding !== void 0 && t.push("decoding"), e.fetchPriority !== void 0 && t.push("fetchPriority"), e.crossOrigin !== void 0 && t.push("crossOrigin"), e.contentMode !== void 0 && t.push("contentMode"), e.resizeMode !== void 0 && t.push("resizeMode"), t.length > 0 && console.warn(
|
|
24
|
+
`Image(template): unsupported props ignored: ${t.join(", ")}`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
async function U(e, t) {
|
|
28
|
+
if (M.has(e))
|
|
29
|
+
return M.get(e);
|
|
30
|
+
if (L.has(e))
|
|
31
|
+
return L.get(e);
|
|
32
|
+
const s = fetch(e).then(async (o) => {
|
|
33
|
+
if (!o.ok)
|
|
34
|
+
throw new Error(`Failed to load SVG: ${o.status}`);
|
|
35
|
+
const i = await o.text(), r = t ? t(i) : N(i);
|
|
36
|
+
if (!r || !/<svg[\s>]/i.test(r))
|
|
37
|
+
throw new Error("Sanitized SVG missing root <svg>");
|
|
38
|
+
return M.set(e, r), r;
|
|
39
|
+
}).finally(() => {
|
|
40
|
+
L.delete(e);
|
|
41
|
+
});
|
|
42
|
+
return L.set(e, s), s;
|
|
43
|
+
}
|
|
44
|
+
class J extends V {
|
|
12
45
|
constructor(t) {
|
|
13
|
-
super(), this.props = t,
|
|
14
|
-
const s =
|
|
46
|
+
super(), this.props = t, m(this, "type", "component"), m(this, "id"), m(this, "mounted", !1), m(this, "cleanup", []), m(this, "effectiveTag"), m(this, "validationResult"), m(this, "loadingStateSignal"), m(this, "setLoadingState"), this.id = `image-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
47
|
+
const s = D("Image", "img", this.props.element);
|
|
15
48
|
if (this.effectiveTag = s.tag, this.validationResult = s.validation, this.props.loadingState)
|
|
16
|
-
this.loadingStateSignal = this.props.loadingState, this.setLoadingState = (
|
|
49
|
+
this.loadingStateSignal = this.props.loadingState, this.setLoadingState = (o) => {
|
|
17
50
|
};
|
|
18
51
|
else {
|
|
19
|
-
const
|
|
20
|
-
this.loadingStateSignal =
|
|
52
|
+
const o = this.props.src ? "idle" : "error", [i, r] = w(o);
|
|
53
|
+
this.loadingStateSignal = i, this.setLoadingState = r;
|
|
21
54
|
}
|
|
22
|
-
|
|
23
|
-
onDOMReady: (
|
|
24
|
-
|
|
55
|
+
k(this, {
|
|
56
|
+
onDOMReady: (o, i) => {
|
|
57
|
+
const r = this.props.renderingMode ?? "original";
|
|
58
|
+
if (r === "template" && i instanceof HTMLSpanElement) {
|
|
59
|
+
this.setupTemplateModeReactivityForDOMElement(i);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (r === "template") {
|
|
63
|
+
process.env.NODE_ENV !== "production" && console.warn(
|
|
64
|
+
"Image(template): expected HTMLSpanElement primary element; skipping mismatched lifecycle binding."
|
|
65
|
+
), this.setLoadingStateWithCallback("error"), this.props.onError?.(new Event("error"));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
i instanceof HTMLImageElement && this.setupLoadingStateReactivityForDOMElement(i);
|
|
25
69
|
}
|
|
26
|
-
}),
|
|
70
|
+
}), F(this);
|
|
27
71
|
}
|
|
28
72
|
/**
|
|
29
73
|
* Set loading state and notify callback
|
|
@@ -38,7 +82,7 @@ class B extends z {
|
|
|
38
82
|
const t = this.loadingStateSignal();
|
|
39
83
|
if (t === "loading" && this.props.placeholder) {
|
|
40
84
|
if (typeof this.props.placeholder == "string")
|
|
41
|
-
return [
|
|
85
|
+
return [v("img", {
|
|
42
86
|
class: "tachui-image-placeholder",
|
|
43
87
|
src: this.props.placeholder,
|
|
44
88
|
alt: "Loading..."
|
|
@@ -48,7 +92,7 @@ class B extends z {
|
|
|
48
92
|
}
|
|
49
93
|
if (t === "error" && this.props.errorPlaceholder) {
|
|
50
94
|
if (typeof this.props.errorPlaceholder == "string")
|
|
51
|
-
return [
|
|
95
|
+
return [v("img", {
|
|
52
96
|
class: "tachui-image-error",
|
|
53
97
|
src: this.props.errorPlaceholder,
|
|
54
98
|
alt: "Error loading image"
|
|
@@ -56,17 +100,30 @@ class B extends z {
|
|
|
56
100
|
if (this.props.errorPlaceholder && typeof this.props.errorPlaceholder == "object")
|
|
57
101
|
return this.props.errorPlaceholder.render();
|
|
58
102
|
}
|
|
59
|
-
const s =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
103
|
+
const s = ["tachui-image"], o = this.createClassString(this.props, s), i = this.props.renderingMode ?? "original";
|
|
104
|
+
let r;
|
|
105
|
+
if (i === "template") {
|
|
106
|
+
q(this.props);
|
|
107
|
+
const n = R(this.props.alt), p = !!R(this.props.decorative) || n === "";
|
|
108
|
+
r = v("span", {
|
|
109
|
+
className: `${o} tachui-image-template`,
|
|
110
|
+
role: "img",
|
|
111
|
+
...p ? { "aria-hidden": "true" } : { "aria-label": n || this.props.accessibilityLabel || "Image" }
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
const n = G(this.props.src);
|
|
115
|
+
r = v(this.effectiveTag, {
|
|
116
|
+
className: o,
|
|
117
|
+
src: n,
|
|
118
|
+
// Pass resolved src for initial render
|
|
119
|
+
alt: this.props.alt,
|
|
120
|
+
// Pass reactive alt directly
|
|
121
|
+
loading: this.props.loadingStrategy || "lazy",
|
|
122
|
+
crossorigin: this.props.crossOrigin,
|
|
123
|
+
decoding: this.props.decoding || "async",
|
|
124
|
+
fetchpriority: this.props.fetchPriority
|
|
125
|
+
});
|
|
126
|
+
}
|
|
70
127
|
return r.componentMetadata = {
|
|
71
128
|
id: this.id,
|
|
72
129
|
type: "Image",
|
|
@@ -79,41 +136,70 @@ class B extends z {
|
|
|
79
136
|
* Set up ImageAsset reactivity for a real DOM element (called from onDOMReady)
|
|
80
137
|
*/
|
|
81
138
|
setupImageAssetReactivityForDOMElement(t, s) {
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
this.props.onLoadStart?.(), this.setLoadingStateWithCallback("loading"), s.src =
|
|
139
|
+
const o = y(() => {
|
|
140
|
+
const i = t.resolve();
|
|
141
|
+
this.props.onLoadStart?.(), this.setLoadingStateWithCallback("loading"), s.src = i;
|
|
142
|
+
});
|
|
143
|
+
this.cleanup.push(() => o.dispose());
|
|
144
|
+
}
|
|
145
|
+
setupTemplateModeReactivityForDOMElement(t) {
|
|
146
|
+
let s = 0;
|
|
147
|
+
const o = y(() => {
|
|
148
|
+
const r = R(this.props.alt) ?? this.props.accessibilityLabel, n = !!R(this.props.decorative) || r === "";
|
|
149
|
+
t.setAttribute("role", "img"), n ? (t.setAttribute("aria-hidden", "true"), t.removeAttribute("aria-label")) : (t.removeAttribute("aria-hidden"), t.setAttribute("aria-label", r || "Image"));
|
|
150
|
+
});
|
|
151
|
+
this.cleanup.push(() => o.dispose());
|
|
152
|
+
const i = y(() => {
|
|
153
|
+
const r = X(this.props.src), n = ++s;
|
|
154
|
+
if (!r) {
|
|
155
|
+
t.innerHTML = "", this.setLoadingStateWithCallback("error"), this.props.onError?.(new Event("error"));
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.props.onLoadStart?.(), this.setLoadingStateWithCallback("loading"), U(r, this.props.customSanitizer).then((p) => {
|
|
159
|
+
if (n !== s)
|
|
160
|
+
return;
|
|
161
|
+
t.innerHTML = p;
|
|
162
|
+
const u = t.querySelector("svg");
|
|
163
|
+
if (!(u instanceof SVGElement))
|
|
164
|
+
throw new Error("No <svg> root after template injection");
|
|
165
|
+
u.setAttribute("aria-hidden", "true"), u.setAttribute("focusable", "false"), u.setAttribute("width", "100%"), u.setAttribute("height", "100%"), this.setLoadingStateWithCallback("loaded"), this.props.onLoad?.(new Event("load"));
|
|
166
|
+
}).catch((p) => {
|
|
167
|
+
n === s && (this.setLoadingStateWithCallback("error"), this.props.onError?.(new Event("error")));
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
this.cleanup.push(() => {
|
|
171
|
+
i.dispose(), s = Number.POSITIVE_INFINITY;
|
|
85
172
|
});
|
|
86
|
-
this.cleanup.push(() => i.dispose());
|
|
87
173
|
}
|
|
88
174
|
setupLoadingStateReactivityForDOMElement(t) {
|
|
89
175
|
const s = (n) => {
|
|
90
176
|
this.setLoadingStateWithCallback("loaded"), this.props.onLoad?.(n);
|
|
91
|
-
},
|
|
177
|
+
}, o = (n) => {
|
|
92
178
|
this.setLoadingStateWithCallback("error"), this.props.onError?.(n);
|
|
93
179
|
};
|
|
94
|
-
t.addEventListener("load", s), t.addEventListener("error",
|
|
95
|
-
t.removeEventListener("load", s), t.removeEventListener("error",
|
|
180
|
+
t.addEventListener("load", s), t.addEventListener("error", o), this.cleanup.push(() => {
|
|
181
|
+
t.removeEventListener("load", s), t.removeEventListener("error", o);
|
|
96
182
|
});
|
|
97
|
-
const
|
|
183
|
+
const i = (n) => {
|
|
98
184
|
if (!n) {
|
|
99
185
|
t.src = "", this.setLoadingStateWithCallback("error");
|
|
100
186
|
return;
|
|
101
187
|
}
|
|
102
188
|
this.props.onLoadStart?.(), this.setLoadingStateWithCallback("loading"), t.src = n;
|
|
103
189
|
};
|
|
104
|
-
if (
|
|
190
|
+
if (H(this.props.src)) {
|
|
105
191
|
this.setupImageAssetReactivityForDOMElement(this.props.src, t);
|
|
106
192
|
return;
|
|
107
193
|
}
|
|
108
194
|
const r = this.props.src;
|
|
109
|
-
if (
|
|
110
|
-
const n =
|
|
111
|
-
|
|
195
|
+
if (x(r) || z(r)) {
|
|
196
|
+
const n = y(() => {
|
|
197
|
+
i(r());
|
|
112
198
|
});
|
|
113
199
|
this.cleanup.push(() => n.dispose());
|
|
114
200
|
return;
|
|
115
201
|
}
|
|
116
|
-
|
|
202
|
+
i(
|
|
117
203
|
typeof this.props.src == "string" ? this.props.src : void 0
|
|
118
204
|
);
|
|
119
205
|
}
|
|
@@ -124,16 +210,16 @@ class B extends z {
|
|
|
124
210
|
* Concatenate this image with another concatenatable component
|
|
125
211
|
*/
|
|
126
212
|
concat(t) {
|
|
127
|
-
const s = this.toSegment(),
|
|
128
|
-
totalSegments: t instanceof
|
|
129
|
-
accessibilityRole: t instanceof
|
|
213
|
+
const s = this.toSegment(), o = t.toSegment(), i = {
|
|
214
|
+
totalSegments: t instanceof A ? t.segments.length + 1 : 2,
|
|
215
|
+
accessibilityRole: t instanceof A ? this.mergeAccessibilityRoles(
|
|
130
216
|
"group",
|
|
131
217
|
t.metadata.accessibilityRole
|
|
132
218
|
) : this.determineAccessibilityRole(t),
|
|
133
219
|
semanticStructure: "inline"
|
|
134
220
|
// Images are typically inline in concatenation
|
|
135
221
|
};
|
|
136
|
-
return new
|
|
222
|
+
return new A([s, o], i);
|
|
137
223
|
}
|
|
138
224
|
/**
|
|
139
225
|
* Convert this image to a segment for concatenation
|
|
@@ -183,44 +269,44 @@ class B extends z {
|
|
|
183
269
|
}
|
|
184
270
|
}
|
|
185
271
|
function P(e, t = {}) {
|
|
186
|
-
const s = { ...t, src: e },
|
|
272
|
+
const s = { ...t, src: e }, o = new J(s), i = f(o), r = (n) => {
|
|
187
273
|
if (n && Array.isArray(n.modifiers))
|
|
188
274
|
return n;
|
|
189
275
|
if (n?._modifiableComponent && Array.isArray(n._modifiableComponent.modifiers))
|
|
190
276
|
return n._modifiableComponent;
|
|
191
|
-
if (Array.isArray(
|
|
192
|
-
return
|
|
193
|
-
if (
|
|
194
|
-
return
|
|
277
|
+
if (Array.isArray(i?.modifiers))
|
|
278
|
+
return i;
|
|
279
|
+
if (i?._modifiableComponent && Array.isArray(i._modifiableComponent.modifiers))
|
|
280
|
+
return i._modifiableComponent;
|
|
195
281
|
throw new Error("Image shorthand target is not modifiable");
|
|
196
282
|
};
|
|
197
|
-
return
|
|
198
|
-
return r(this).modifiers.push(
|
|
199
|
-
},
|
|
200
|
-
return r(this).modifiers.push(
|
|
201
|
-
},
|
|
283
|
+
return i.scaledToFit = function() {
|
|
284
|
+
return r(this).modifiers.push($(void 0, "fit")), i;
|
|
285
|
+
}, i.scaledToFill = function() {
|
|
286
|
+
return r(this).modifiers.push($(void 0, "fill")), i;
|
|
287
|
+
}, i;
|
|
202
288
|
}
|
|
203
|
-
const
|
|
289
|
+
const nt = {
|
|
204
290
|
idle: "idle",
|
|
205
291
|
loading: "loading",
|
|
206
292
|
loaded: "loaded",
|
|
207
293
|
error: "error"
|
|
208
|
-
},
|
|
294
|
+
}, lt = {
|
|
209
295
|
fit: "fit",
|
|
210
296
|
fill: "fill",
|
|
211
297
|
stretch: "stretch",
|
|
212
298
|
center: "center",
|
|
213
299
|
scaleDown: "scaleDown"
|
|
214
|
-
},
|
|
300
|
+
}, at = {
|
|
215
301
|
/**
|
|
216
302
|
* Create a responsive image with multiple sources
|
|
217
303
|
*/
|
|
218
304
|
responsive(e, t, s = {}) {
|
|
219
|
-
const
|
|
220
|
-
const r = [
|
|
221
|
-
return
|
|
305
|
+
const o = e.map((i) => {
|
|
306
|
+
const r = [i.src];
|
|
307
|
+
return i.width && r.push(`${i.width}w`), r.join(" ");
|
|
222
308
|
}).join(", ");
|
|
223
|
-
return P(t, { ...s, srcSet:
|
|
309
|
+
return P(t, { ...s, srcSet: o });
|
|
224
310
|
},
|
|
225
311
|
/**
|
|
226
312
|
* Create an image with progressive loading
|
|
@@ -242,23 +328,23 @@ const Q = {
|
|
|
242
328
|
});
|
|
243
329
|
}
|
|
244
330
|
};
|
|
245
|
-
var
|
|
246
|
-
class
|
|
247
|
-
constructor(t, s,
|
|
248
|
-
this.props = t, this.tag = s, this.content =
|
|
331
|
+
var K = Object.defineProperty, Z = (e, t, s) => t in e ? K(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, I = (e, t, s) => Z(e, typeof t != "symbol" ? t + "" : t, s);
|
|
332
|
+
class S {
|
|
333
|
+
constructor(t, s, o, i = {}) {
|
|
334
|
+
this.props = t, this.tag = s, this.content = o, this.attributes = i, I(this, "type", "component"), I(this, "id"), I(this, "mounted", !1), I(this, "cleanup", []), this.id = `element-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
249
335
|
}
|
|
250
336
|
render() {
|
|
251
337
|
return [
|
|
252
|
-
|
|
338
|
+
v(this.tag, this.attributes, this.content ? Y(this.content) : "")
|
|
253
339
|
];
|
|
254
340
|
}
|
|
255
341
|
}
|
|
256
|
-
const
|
|
342
|
+
const E = {
|
|
257
343
|
/**
|
|
258
344
|
* Create a div element with modifier support
|
|
259
345
|
*/
|
|
260
346
|
div: (e = {}) => {
|
|
261
|
-
const t = new
|
|
347
|
+
const t = new S(
|
|
262
348
|
e,
|
|
263
349
|
"div",
|
|
264
350
|
e.children ? String(e.children) : void 0
|
|
@@ -269,7 +355,7 @@ const y = {
|
|
|
269
355
|
* Create a span element with modifier support
|
|
270
356
|
*/
|
|
271
357
|
span: (e = {}) => {
|
|
272
|
-
const t = new
|
|
358
|
+
const t = new S(
|
|
273
359
|
e,
|
|
274
360
|
"span",
|
|
275
361
|
e.children ? String(e.children) : void 0
|
|
@@ -280,7 +366,7 @@ const y = {
|
|
|
280
366
|
* Create an anchor element with modifier support
|
|
281
367
|
*/
|
|
282
368
|
a: (e = {}) => {
|
|
283
|
-
const t = new
|
|
369
|
+
const t = new S(
|
|
284
370
|
e,
|
|
285
371
|
"a",
|
|
286
372
|
e.children ? String(e.children) : void 0,
|
|
@@ -295,7 +381,7 @@ const y = {
|
|
|
295
381
|
* Create a paragraph element with modifier support
|
|
296
382
|
*/
|
|
297
383
|
p: (e = {}) => {
|
|
298
|
-
const t = new
|
|
384
|
+
const t = new S(
|
|
299
385
|
e,
|
|
300
386
|
"p",
|
|
301
387
|
e.children ? String(e.children) : void 0
|
|
@@ -309,7 +395,7 @@ const y = {
|
|
|
309
395
|
* use the main Button component instead.
|
|
310
396
|
*/
|
|
311
397
|
button: (e = {}) => {
|
|
312
|
-
const t = new
|
|
398
|
+
const t = new S(
|
|
313
399
|
e,
|
|
314
400
|
"button",
|
|
315
401
|
e.children ? String(e.children) : void 0,
|
|
@@ -323,13 +409,13 @@ const y = {
|
|
|
323
409
|
* Create an input element with modifier support
|
|
324
410
|
*/
|
|
325
411
|
input: (e = {}) => {
|
|
326
|
-
const t = new
|
|
412
|
+
const t = new S(e, "input", void 0, {
|
|
327
413
|
type: e.type || "text",
|
|
328
414
|
value: e.value || "",
|
|
329
415
|
placeholder: e.placeholder || "",
|
|
330
416
|
oninput: (s) => {
|
|
331
|
-
const
|
|
332
|
-
e.onChange?.(
|
|
417
|
+
const o = s.target;
|
|
418
|
+
e.onChange?.(o.value);
|
|
333
419
|
}
|
|
334
420
|
});
|
|
335
421
|
return f(t);
|
|
@@ -341,7 +427,7 @@ const y = {
|
|
|
341
427
|
* use the main Image component instead.
|
|
342
428
|
*/
|
|
343
429
|
img: (e) => {
|
|
344
|
-
const t = new
|
|
430
|
+
const t = new S(e, "img", void 0, {
|
|
345
431
|
src: e.src,
|
|
346
432
|
alt: e.alt || "",
|
|
347
433
|
width: e.width,
|
|
@@ -353,20 +439,20 @@ const y = {
|
|
|
353
439
|
* Create a heading element with modifier support
|
|
354
440
|
*/
|
|
355
441
|
heading: (e) => (t = {}) => {
|
|
356
|
-
const s = new
|
|
442
|
+
const s = new S(
|
|
357
443
|
t,
|
|
358
444
|
`h${e}`,
|
|
359
445
|
t.children ? String(t.children) : void 0
|
|
360
446
|
);
|
|
361
447
|
return f(s);
|
|
362
448
|
}
|
|
363
|
-
},
|
|
364
|
-
var
|
|
365
|
-
class
|
|
449
|
+
}, ct = E.heading(1), ht = E.heading(2), dt = E.heading(3), pt = E.heading(4), ft = E.heading(5), ut = E.heading(6);
|
|
450
|
+
var Q = Object.defineProperty, tt = (e, t, s) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, l = (e, t, s) => tt(e, typeof t != "symbol" ? t + "" : t, s);
|
|
451
|
+
class et {
|
|
366
452
|
constructor(t) {
|
|
367
453
|
this.props = t, l(this, "type", "component"), l(this, "id"), l(this, "mounted", !1), l(this, "cleanup", []), l(this, "scrollElement", null), l(this, "contentOffsetSignal"), l(this, "setContentOffset"), l(this, "contentSizeSignal"), l(this, "setContentSize"), l(this, "setIsScrolling"), l(this, "pullToRefreshStateSignal"), l(this, "setPullToRefreshState"), l(this, "scrollEventThrottle"), l(this, "lastScrollTime", 0), l(this, "scrollVelocity", { x: 0, y: 0 }), l(this, "lastScrollOffset", { x: 0, y: 0 }), l(this, "pullStartY", 0), l(this, "isPulling", !1), l(this, "handleScroll", (h) => {
|
|
368
454
|
if (!this.scrollElement) return;
|
|
369
|
-
const
|
|
455
|
+
const g = performance.now(), a = g - this.lastScrollTime;
|
|
370
456
|
if (a < this.scrollEventThrottle) return;
|
|
371
457
|
const d = {
|
|
372
458
|
x: this.scrollElement.scrollLeft,
|
|
@@ -376,7 +462,7 @@ class q {
|
|
|
376
462
|
width: this.scrollElement.scrollWidth,
|
|
377
463
|
height: this.scrollElement.scrollHeight
|
|
378
464
|
});
|
|
379
|
-
const c = this.detectScrollEdges(),
|
|
465
|
+
const c = this.detectScrollEdges(), T = {
|
|
380
466
|
offset: d,
|
|
381
467
|
velocity: this.scrollVelocity,
|
|
382
468
|
contentSize: {
|
|
@@ -389,7 +475,7 @@ class q {
|
|
|
389
475
|
},
|
|
390
476
|
edges: c
|
|
391
477
|
};
|
|
392
|
-
this.props.onScroll && this.props.onScroll(
|
|
478
|
+
this.props.onScroll && this.props.onScroll(T), c.top && this.props.onReachTop && this.props.onReachTop(), c.bottom && this.props.onReachBottom && this.props.onReachBottom(), c.left && this.props.onReachLeft && this.props.onReachLeft(), c.right && this.props.onReachRight && this.props.onReachRight(), this.lastScrollOffset = d, this.lastScrollTime = g;
|
|
393
479
|
}), l(this, "handleScrollStart", () => {
|
|
394
480
|
this.setIsScrolling(!0), this.props.onScrollBegin && this.props.onScrollBegin();
|
|
395
481
|
}), l(this, "handleScrollEnd", () => {
|
|
@@ -406,8 +492,8 @@ class q {
|
|
|
406
492
|
this.setPullToRefreshState("refreshing");
|
|
407
493
|
try {
|
|
408
494
|
await this.props.refreshControl.onRefresh();
|
|
409
|
-
} catch (
|
|
410
|
-
console.error("Pull to refresh error:",
|
|
495
|
+
} catch (g) {
|
|
496
|
+
console.error("Pull to refresh error:", g);
|
|
411
497
|
} finally {
|
|
412
498
|
this.setPullToRefreshState("idle");
|
|
413
499
|
}
|
|
@@ -415,29 +501,29 @@ class q {
|
|
|
415
501
|
this.setPullToRefreshState("idle");
|
|
416
502
|
this.isPulling = !1;
|
|
417
503
|
}), this.id = `scrollview-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.scrollEventThrottle = t.scrollEventThrottle || 16;
|
|
418
|
-
const [s,
|
|
504
|
+
const [s, o] = w(
|
|
419
505
|
{ x: 0, y: 0 }
|
|
420
506
|
);
|
|
421
|
-
this.contentOffsetSignal = s, this.setContentOffset =
|
|
422
|
-
const [
|
|
507
|
+
this.contentOffsetSignal = s, this.setContentOffset = o;
|
|
508
|
+
const [i, r] = w({
|
|
423
509
|
width: 0,
|
|
424
510
|
height: 0
|
|
425
511
|
});
|
|
426
|
-
this.contentSizeSignal =
|
|
427
|
-
const [, n] =
|
|
512
|
+
this.contentSizeSignal = i, this.setContentSize = r;
|
|
513
|
+
const [, n] = w(!1);
|
|
428
514
|
this.setIsScrolling = n;
|
|
429
|
-
const [
|
|
430
|
-
if (this.pullToRefreshStateSignal =
|
|
515
|
+
const [p, u] = w("idle");
|
|
516
|
+
if (this.pullToRefreshStateSignal = p, this.setPullToRefreshState = u, t.contentOffset && b(t.contentOffset)) {
|
|
431
517
|
this.setContentOffset(t.contentOffset());
|
|
432
|
-
const h =
|
|
433
|
-
t.contentOffset &&
|
|
518
|
+
const h = y(() => {
|
|
519
|
+
t.contentOffset && b(t.contentOffset) && this.setContentOffset(t.contentOffset());
|
|
434
520
|
});
|
|
435
521
|
this.cleanup.push(() => h.dispose());
|
|
436
522
|
}
|
|
437
|
-
if (t.contentSize &&
|
|
523
|
+
if (t.contentSize && b(t.contentSize)) {
|
|
438
524
|
this.setContentSize(t.contentSize());
|
|
439
|
-
const h =
|
|
440
|
-
t.contentSize &&
|
|
525
|
+
const h = y(() => {
|
|
526
|
+
t.contentSize && b(t.contentSize) && this.setContentSize(t.contentSize());
|
|
441
527
|
});
|
|
442
528
|
this.cleanup.push(() => h.dispose());
|
|
443
529
|
}
|
|
@@ -446,10 +532,10 @@ class q {
|
|
|
446
532
|
* Calculate scroll velocity
|
|
447
533
|
*/
|
|
448
534
|
calculateVelocity(t, s) {
|
|
449
|
-
const
|
|
535
|
+
const o = t.x - this.lastScrollOffset.x, i = t.y - this.lastScrollOffset.y;
|
|
450
536
|
return {
|
|
451
|
-
x: s > 0 ?
|
|
452
|
-
y: s > 0 ?
|
|
537
|
+
x: s > 0 ? o / s : 0,
|
|
538
|
+
y: s > 0 ? i / s : 0
|
|
453
539
|
};
|
|
454
540
|
}
|
|
455
541
|
/**
|
|
@@ -461,16 +547,16 @@ class q {
|
|
|
461
547
|
const {
|
|
462
548
|
scrollTop: t,
|
|
463
549
|
scrollLeft: s,
|
|
464
|
-
scrollHeight:
|
|
465
|
-
scrollWidth:
|
|
550
|
+
scrollHeight: o,
|
|
551
|
+
scrollWidth: i,
|
|
466
552
|
clientHeight: r,
|
|
467
553
|
clientWidth: n
|
|
468
554
|
} = this.scrollElement;
|
|
469
555
|
return {
|
|
470
556
|
top: t <= 0,
|
|
471
|
-
bottom: t + r >=
|
|
557
|
+
bottom: t + r >= o - 1,
|
|
472
558
|
left: s <= 0,
|
|
473
|
-
right: s + n >=
|
|
559
|
+
right: s + n >= i - 1
|
|
474
560
|
};
|
|
475
561
|
}
|
|
476
562
|
/**
|
|
@@ -478,14 +564,14 @@ class q {
|
|
|
478
564
|
*/
|
|
479
565
|
setupScrollHandlers(t) {
|
|
480
566
|
let s;
|
|
481
|
-
const
|
|
567
|
+
const o = () => {
|
|
482
568
|
clearTimeout(s), this.handleScrollStart();
|
|
483
|
-
},
|
|
569
|
+
}, i = () => {
|
|
484
570
|
clearTimeout(s), s = setTimeout(() => {
|
|
485
571
|
this.handleScrollEnd();
|
|
486
572
|
}, 150);
|
|
487
573
|
}, r = (n) => {
|
|
488
|
-
|
|
574
|
+
o(), this.handleScroll(n), i();
|
|
489
575
|
};
|
|
490
576
|
t.addEventListener("scroll", r, { passive: !0 }), t.addEventListener("touchstart", this.handleTouchStart, {
|
|
491
577
|
passive: !0
|
|
@@ -525,19 +611,19 @@ class q {
|
|
|
525
611
|
* Apply additional scroll view styling (position and overflow already set in initial render)
|
|
526
612
|
*/
|
|
527
613
|
applyScrollViewStyles(t) {
|
|
528
|
-
const { showsScrollIndicator: s = !0, bounces:
|
|
614
|
+
const { showsScrollIndicator: s = !0, bounces: o = !0 } = this.props;
|
|
529
615
|
if (!s) {
|
|
530
616
|
t.style.scrollbarWidth = "none", t.style.msOverflowStyle = "none";
|
|
531
|
-
const
|
|
532
|
-
|
|
617
|
+
const i = document.createElement("style");
|
|
618
|
+
i.textContent = `
|
|
533
619
|
#${t.id}::-webkit-scrollbar {
|
|
534
620
|
display: none;
|
|
535
621
|
}
|
|
536
|
-
`, document.head.appendChild(
|
|
537
|
-
document.head.removeChild(
|
|
622
|
+
`, document.head.appendChild(i), this.cleanup.push(() => {
|
|
623
|
+
document.head.removeChild(i);
|
|
538
624
|
});
|
|
539
625
|
}
|
|
540
|
-
|
|
626
|
+
o ? t.style.webkitOverflowScrolling = "touch" : t.style.overscrollBehavior = "none", t.style.scrollBehavior = "smooth";
|
|
541
627
|
}
|
|
542
628
|
/**
|
|
543
629
|
* Apply content insets
|
|
@@ -545,8 +631,8 @@ class q {
|
|
|
545
631
|
applyContentInsets(t) {
|
|
546
632
|
const { contentInset: s } = this.props;
|
|
547
633
|
if (s) {
|
|
548
|
-
const { top:
|
|
549
|
-
t.style.padding = `${
|
|
634
|
+
const { top: o = 0, bottom: i = 0, left: r = 0, right: n = 0 } = s;
|
|
635
|
+
t.style.padding = `${o}px ${n}px ${i}px ${r}px`;
|
|
550
636
|
}
|
|
551
637
|
}
|
|
552
638
|
/**
|
|
@@ -555,28 +641,28 @@ class q {
|
|
|
555
641
|
createPullToRefreshIndicator() {
|
|
556
642
|
if (!this.props.refreshControl?.enabled) return null;
|
|
557
643
|
const t = this.pullToRefreshStateSignal(), s = this.props.refreshControl.tintColor || "#007AFF";
|
|
558
|
-
let
|
|
644
|
+
let o = "";
|
|
559
645
|
switch (t) {
|
|
560
646
|
case "pulling":
|
|
561
|
-
|
|
647
|
+
o = "↓ Pull to refresh";
|
|
562
648
|
break;
|
|
563
649
|
case "ready":
|
|
564
|
-
|
|
650
|
+
o = "↑ Release to refresh";
|
|
565
651
|
break;
|
|
566
652
|
case "refreshing":
|
|
567
|
-
|
|
653
|
+
o = "⟳ Refreshing...";
|
|
568
654
|
break;
|
|
569
655
|
default:
|
|
570
|
-
|
|
656
|
+
o = "";
|
|
571
657
|
}
|
|
572
|
-
return
|
|
658
|
+
return o ? {
|
|
573
659
|
type: "component",
|
|
574
660
|
id: `${this.id}-refresh`,
|
|
575
661
|
mounted: !1,
|
|
576
662
|
cleanup: [],
|
|
577
663
|
props: {},
|
|
578
664
|
render: () => [
|
|
579
|
-
|
|
665
|
+
v(
|
|
580
666
|
"div",
|
|
581
667
|
{
|
|
582
668
|
style: {
|
|
@@ -596,7 +682,7 @@ class q {
|
|
|
596
682
|
opacity: t === "idle" ? 0 : 1
|
|
597
683
|
}
|
|
598
684
|
},
|
|
599
|
-
|
|
685
|
+
o
|
|
600
686
|
)
|
|
601
687
|
]
|
|
602
688
|
} : null;
|
|
@@ -606,8 +692,8 @@ class q {
|
|
|
606
692
|
*/
|
|
607
693
|
scrollTo(t, s = "smooth") {
|
|
608
694
|
if (!this.scrollElement) return;
|
|
609
|
-
const
|
|
610
|
-
t.x !== void 0 && (
|
|
695
|
+
const o = { behavior: s };
|
|
696
|
+
t.x !== void 0 && (o.left = t.x), t.y !== void 0 && (o.top = t.y), this.scrollElement.scrollTo(o);
|
|
611
697
|
}
|
|
612
698
|
/**
|
|
613
699
|
* Scroll to top
|
|
@@ -632,13 +718,13 @@ class q {
|
|
|
632
718
|
*/
|
|
633
719
|
render() {
|
|
634
720
|
const { children: t = [], scrollEnabled: s = !0 } = this.props;
|
|
635
|
-
let
|
|
636
|
-
const
|
|
637
|
-
if (typeof
|
|
638
|
-
const a =
|
|
639
|
-
|
|
640
|
-
} else Array.isArray(t) && (
|
|
641
|
-
const r =
|
|
721
|
+
let o = [];
|
|
722
|
+
const i = t;
|
|
723
|
+
if (typeof i == "function") {
|
|
724
|
+
const a = i();
|
|
725
|
+
o = Array.isArray(a) ? a : [];
|
|
726
|
+
} else Array.isArray(t) && (o = t);
|
|
727
|
+
const r = v(
|
|
642
728
|
"div",
|
|
643
729
|
{
|
|
644
730
|
class: "tachui-scrollview-content",
|
|
@@ -647,14 +733,14 @@ class q {
|
|
|
647
733
|
minWidth: "100%"
|
|
648
734
|
}
|
|
649
735
|
},
|
|
650
|
-
...
|
|
651
|
-
), n = this.createPullToRefreshIndicator(),
|
|
736
|
+
...o.flatMap((a) => a.render())
|
|
737
|
+
), n = this.createPullToRefreshIndicator(), p = [];
|
|
652
738
|
if (n) {
|
|
653
739
|
const a = n.render(), d = Array.isArray(a) ? a : [a];
|
|
654
|
-
|
|
740
|
+
p.push(...d.filter((c) => c));
|
|
655
741
|
}
|
|
656
|
-
|
|
657
|
-
const { direction:
|
|
742
|
+
p.push(r);
|
|
743
|
+
const { direction: u = "vertical" } = this.props, h = this.getOverflowStyles(u), g = v(
|
|
658
744
|
"div",
|
|
659
745
|
{
|
|
660
746
|
id: this.id,
|
|
@@ -666,46 +752,46 @@ class q {
|
|
|
666
752
|
...h
|
|
667
753
|
}
|
|
668
754
|
},
|
|
669
|
-
...
|
|
755
|
+
...p
|
|
670
756
|
);
|
|
671
|
-
if (
|
|
672
|
-
const a =
|
|
757
|
+
if (g.element) {
|
|
758
|
+
const a = g.element;
|
|
673
759
|
this.scrollElement = a, this.applyScrollViewStyles(a), this.setupScrollHandlers(a), r.element && this.applyContentInsets(r.element);
|
|
674
760
|
const d = () => {
|
|
675
|
-
const c =
|
|
761
|
+
const c = b(s) ? s() : s;
|
|
676
762
|
a.style.overflow = c ? "auto" : "hidden", a.style.pointerEvents = c ? "auto" : "none";
|
|
677
763
|
};
|
|
678
|
-
if (
|
|
679
|
-
const c =
|
|
764
|
+
if (b(s)) {
|
|
765
|
+
const c = y(d);
|
|
680
766
|
this.cleanup.push(() => c.dispose());
|
|
681
767
|
} else
|
|
682
768
|
d();
|
|
683
|
-
if (typeof
|
|
684
|
-
const c =
|
|
685
|
-
const
|
|
769
|
+
if (typeof i == "function") {
|
|
770
|
+
const c = y(() => {
|
|
771
|
+
const T = i(), W = (Array.isArray(T) ? T : []).flatMap((C) => C.render());
|
|
686
772
|
if (r.element) {
|
|
687
773
|
const C = r.element;
|
|
688
|
-
C.innerHTML = "",
|
|
689
|
-
|
|
774
|
+
C.innerHTML = "", W.forEach((O) => {
|
|
775
|
+
O && O.element && C.appendChild(O.element);
|
|
690
776
|
});
|
|
691
777
|
}
|
|
692
778
|
});
|
|
693
779
|
this.cleanup.push(() => c.dispose());
|
|
694
780
|
}
|
|
695
781
|
}
|
|
696
|
-
return [
|
|
782
|
+
return [g];
|
|
697
783
|
}
|
|
698
784
|
}
|
|
699
|
-
function
|
|
700
|
-
const t = new
|
|
785
|
+
function _(e = {}) {
|
|
786
|
+
const t = new et(e);
|
|
701
787
|
return f(t);
|
|
702
788
|
}
|
|
703
|
-
const
|
|
789
|
+
const gt = {
|
|
704
790
|
/**
|
|
705
791
|
* Create a scroll view with pull to refresh
|
|
706
792
|
*/
|
|
707
793
|
withRefresh(e, t, s = {}) {
|
|
708
|
-
return
|
|
794
|
+
return _({
|
|
709
795
|
children: e,
|
|
710
796
|
refreshControl: {
|
|
711
797
|
enabled: !0,
|
|
@@ -718,7 +804,7 @@ const at = {
|
|
|
718
804
|
* Create a horizontal scroll view
|
|
719
805
|
*/
|
|
720
806
|
horizontal(e, t = {}) {
|
|
721
|
-
return
|
|
807
|
+
return _({
|
|
722
808
|
...t,
|
|
723
809
|
children: e,
|
|
724
810
|
direction: "horizontal"
|
|
@@ -728,7 +814,7 @@ const at = {
|
|
|
728
814
|
* Create a paged scroll view
|
|
729
815
|
*/
|
|
730
816
|
paged(e, t = {}) {
|
|
731
|
-
return
|
|
817
|
+
return _({
|
|
732
818
|
...t,
|
|
733
819
|
children: e,
|
|
734
820
|
pagingEnabled: !0
|
|
@@ -736,19 +822,19 @@ const at = {
|
|
|
736
822
|
}
|
|
737
823
|
};
|
|
738
824
|
export {
|
|
739
|
-
|
|
740
|
-
|
|
825
|
+
J as E,
|
|
826
|
+
E as H,
|
|
741
827
|
P as I,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
828
|
+
_ as S,
|
|
829
|
+
nt as a,
|
|
830
|
+
lt as b,
|
|
831
|
+
at as c,
|
|
832
|
+
ct as d,
|
|
833
|
+
ht as e,
|
|
834
|
+
dt as f,
|
|
835
|
+
pt as g,
|
|
836
|
+
ft as h,
|
|
837
|
+
ut as i,
|
|
838
|
+
et as j,
|
|
839
|
+
gt as k
|
|
754
840
|
};
|
package/dist/display/Image.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { type ElementOverrideProps } from '@tachui/core';
|
|
|
15
15
|
import { ComponentWithCSSClasses, type CSSClassesProps } from '@tachui/core';
|
|
16
16
|
type ImageAssetLike = ImageAsset | ImageAssetProxy;
|
|
17
17
|
type ImageSource = string | Signal<string> | ImageAssetLike;
|
|
18
|
+
type ImageRenderingMode = 'original' | 'template';
|
|
18
19
|
/**
|
|
19
20
|
* Image loading state
|
|
20
21
|
*/
|
|
@@ -33,6 +34,9 @@ export type ImageResizeMode = 'cover' | 'contain' | 'fill' | 'none';
|
|
|
33
34
|
export type ImageLoadingStrategy = 'eager' | 'lazy';
|
|
34
35
|
export interface ImageProps extends ComponentProps, ElementOverrideProps, CSSClassesProps {
|
|
35
36
|
src?: ImageSource;
|
|
37
|
+
renderingMode?: ImageRenderingMode;
|
|
38
|
+
decorative?: boolean | Signal<boolean>;
|
|
39
|
+
customSanitizer?: (markup: string) => string;
|
|
36
40
|
srcSet?: string | Signal<string>;
|
|
37
41
|
alt?: string | Signal<string>;
|
|
38
42
|
width?: number | string | Signal<number | string>;
|
|
@@ -86,6 +90,7 @@ export declare class EnhancedImage extends ComponentWithCSSClasses implements Co
|
|
|
86
90
|
* Set up ImageAsset reactivity for a real DOM element (called from onDOMReady)
|
|
87
91
|
*/
|
|
88
92
|
private setupImageAssetReactivityForDOMElement;
|
|
93
|
+
private setupTemplateModeReactivityForDOMElement;
|
|
89
94
|
private setupLoadingStateReactivityForDOMElement;
|
|
90
95
|
/**
|
|
91
96
|
* Concatenate this image with another concatenatable component
|
|
@@ -133,6 +138,7 @@ export interface ImageWithShorthands extends ModifiableComponentWithModifiers<Im
|
|
|
133
138
|
scaledToFill(): ImageWithShorthands;
|
|
134
139
|
}
|
|
135
140
|
export declare function Image(src: ImageSource, props?: Omit<ImageProps, 'src'>): ImageWithShorthands;
|
|
141
|
+
export declare function __resetImageTemplateCacheForTests(): void;
|
|
136
142
|
/**
|
|
137
143
|
* Image loading states for external use
|
|
138
144
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/display/Image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,gCAAgC,EACjC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAA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AE,KAAK,GAAG,eAAe,GAAG,gBAAgB,CAAC,GAClE,mBAAmB,CAAC,UAAU,CAAC,GAAG;QACnC,QAAQ,EAAE,eAAe,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAA;KAC3D;IAQD;;OAEG;yBAEI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,kBACZ,MAAM,UACf,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,aAAa,CAAC,GAC7C,mBAAmB,CAAC,UAAU,CAAC,GAAG;QACnC,QAAQ,EAAE,eAAe,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAA;KAC3D;CAMF,CAAA"}
|
package/dist/display/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as e, H as t, T as o, a as H, b as l, c as n } from "../Text-WpP4H9se.js";
|
|
2
|
-
import { E as c, j as g, d as m, e as i, f as T, g as d, h as x, i as I, H as S, I as h, b as E, a as p, c as f, S as w, k as y } from "../ScrollView-
|
|
2
|
+
import { E as c, j as g, d as m, e as i, f as T, g as d, h as x, i as I, H as S, I as h, b as E, a as p, c as f, S as w, k as y } from "../ScrollView-4WhOoZol.js";
|
|
3
3
|
export {
|
|
4
4
|
c as EnhancedImage,
|
|
5
5
|
g as EnhancedScrollView,
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Divider as b, DividerComponent as P, DividerStyles as I, DividerUtils as y, HStack as j, Spacer as S, SpacerComponent as A, VStack as L, ZStack as C, defaultDividerTheme as V } from "./layout/index.js";
|
|
2
2
|
import { E as O, H as E, T as $, a as F, b as q, c as U } from "./Text-WpP4H9se.js";
|
|
3
|
-
import { E as N, j as _, d as W, e as R, f as M, g as G, h as K, i as Z, H as z, I as J, b as Q, a as X, c as Y, S as ee, k as te } from "./ScrollView-
|
|
3
|
+
import { E as N, j as _, d as W, e as R, f as M, g as G, h as K, i as Z, H as z, I as J, b as Q, a as X, c as Y, S as ee, k as te } from "./ScrollView-4WhOoZol.js";
|
|
4
4
|
import { B as ne, a as ie, E as re, h as ae, c as se, L as ce, b as le, P as pe, i as de, j as ge, T as ue, e as me, f as he, g as fe, d as ve } from "./Picker-CpERkpVp.js";
|
|
5
5
|
import { B as xe, a as ke, b as Be, c as Te, d as be, e as Pe, f as Ie } from "./BasicInput-BHfrSdoi.js";
|
|
6
6
|
import { withModifiers as je } from "@tachui/core";
|
|
@@ -425,7 +425,7 @@ const w = {
|
|
|
425
425
|
}
|
|
426
426
|
console.groupEnd();
|
|
427
427
|
}
|
|
428
|
-
}, h = "@tachui/primitives", f = "0.8.
|
|
428
|
+
}, h = "@tachui/primitives", f = "0.8.18", x = h, k = f;
|
|
429
429
|
export {
|
|
430
430
|
xe as BasicForm,
|
|
431
431
|
ke as BasicFormImplementation,
|
package/dist/layout/Spacer.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SwiftUI-inspired Spacer component that expands to fill available space
|
|
5
5
|
* along the main axis of its container. Behaves like SwiftUI.Spacer.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { ModifiableComponentWithModifiers } from '@tachui/core';
|
|
8
8
|
import type { ComponentProps, DOMNode } from '@tachui/core';
|
|
9
9
|
import { ComponentWithCSSClasses, type CSSClassesProps } from '@tachui/core';
|
|
10
10
|
import type { CloneableComponent, CloneOptions } from '@tachui/core/runtime/types';
|
|
@@ -32,10 +32,6 @@ export declare class SpacerComponent extends ComponentWithCSSClasses implements
|
|
|
32
32
|
/**
|
|
33
33
|
* Create a Spacer component with optional minimum length
|
|
34
34
|
*/
|
|
35
|
-
export declare function Spacer(minLength?: number):
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
export declare function Spacer(props?: SpacerProps): ModifiableComponent<SpacerProps> & {
|
|
39
|
-
modifier: ModifierBuilder<ModifiableComponent<SpacerProps>>;
|
|
40
|
-
};
|
|
35
|
+
export declare function Spacer(minLength?: number): ModifiableComponentWithModifiers<SpacerProps>;
|
|
36
|
+
export declare function Spacer(props?: SpacerProps): ModifiableComponentWithModifiers<SpacerProps>;
|
|
41
37
|
//# sourceMappingURL=Spacer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../../src/layout/Spacer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../../src/layout/Spacer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAMlF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc,EAAE,eAAe;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,eACX,SAAQ,uBACR,YAAW,kBAAkB,CAAC,WAAW,CAAC;IAE1C,SAAgB,IAAI,EAAG,WAAW,CAAS;IAC3C,SAAgB,EAAE,EAAE,MAAM,CAAA;IAC1B,SAAgB,KAAK,EAAE,WAAW,CAAA;IAC3B,OAAO,UAAQ;IACf,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAK;gBAEvB,KAAK,EAAE,WAAW;IAM9B,MAAM,IAAI,OAAO;IAgCjB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,IAAI;IAIvC,YAAY,IAAI,IAAI;IAOpB,SAAS,IAAI,IAAI;CAQlB;AAED;;GAEG;AACH,wBAAgB,MAAM,CACpB,SAAS,CAAC,EAAE,MAAM,GACjB,gCAAgC,CAAC,WAAW,CAAC,CAAA;AAChD,wBAAgB,MAAM,CACpB,KAAK,CAAC,EAAE,WAAW,GAClB,gCAAgC,CAAC,WAAW,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachui/primitives",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.18",
|
|
4
4
|
"description": "Basic UI components for tachUI framework",
|
|
5
5
|
"homepage": "https://tachui.dev/",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tachui/core": "0.8.
|
|
37
|
-
"@tachui/modifiers": "0.8.
|
|
36
|
+
"@tachui/core": "0.8.18",
|
|
37
|
+
"@tachui/modifiers": "0.8.18"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^20.0.0",
|