@mkbabb/glass-ui 3.10.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ToggleGroupItem-Cev4pOVK.js → ToggleGroupItem-COu_4IW4.js} +17 -13
- package/dist/api/index.d.ts +1 -1
- package/dist/api.js +2 -2
- package/dist/aurora.js +77 -77
- package/dist/components/custom/aurora/constants/presets.d.ts +62 -5
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/dock/GlassDock.vue.d.ts +5 -1
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +10 -7
- package/dist/components/custom/handmark/brush.d.ts +23 -0
- package/dist/components/custom/handmark/geometry.d.ts +20 -2
- package/dist/components/custom/handmark/index.d.ts +2 -2
- package/dist/components/custom/handmark/useHandMark.d.ts +26 -5
- package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
- package/dist/components/ui/toggle/index.d.ts +1 -1
- package/dist/components/ui/toggle-group/ToggleGroup.vue.d.ts +7 -1
- package/dist/components/ui/toggle-group/ToggleGroupItem.vue.d.ts +3 -1
- package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +13 -0
- package/dist/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +21 -1
- package/dist/controls.js +1 -1
- package/dist/dark.d.ts +1 -1
- package/dist/dark.js +1 -1
- package/dist/dock.js +191 -174
- package/dist/expandable-container.js +67 -49
- package/dist/fourier-field.js +1 -1
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +2 -2
- package/dist/handmark.js +176 -123
- package/dist/labeled-field.js +1 -1
- package/dist/{presets-Dkdv55Gt.js → presets-BP_ALM0m.js} +14 -1
- package/dist/{slider-CyzcxBoh.js → slider-ClgpP7EB.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/styles/animations.css +40 -0
- package/dist/styles/components.css +1 -1
- package/dist/styles/tokens.css +5 -0
- package/dist/styles/utilities.css +44 -13
- package/dist/toggle-group.js +1 -1
- package/dist/{useGlobalDark-d6waty-X.js → useGlobalDark-D1wgEqfW.js} +21 -2
- package/package.json +10 -4
- package/src/styles/animations.css +40 -0
- package/src/styles/tokens.css +5 -0
- package/src/styles/utilities.css +44 -13
package/dist/handmark.js
CHANGED
|
@@ -72,6 +72,29 @@ var T = {
|
|
|
72
72
|
segments: 13,
|
|
73
73
|
cap: "round"
|
|
74
74
|
},
|
|
75
|
+
ring: {
|
|
76
|
+
weight: 5,
|
|
77
|
+
weightJitter: .6,
|
|
78
|
+
thinning: .3,
|
|
79
|
+
taper: {
|
|
80
|
+
start: 8,
|
|
81
|
+
end: 12,
|
|
82
|
+
ease: "out-cubic"
|
|
83
|
+
},
|
|
84
|
+
ribbon: "stroke",
|
|
85
|
+
opacity: .55,
|
|
86
|
+
blend: "source-over",
|
|
87
|
+
passes: 1,
|
|
88
|
+
passOpacity: 0,
|
|
89
|
+
grain: .7,
|
|
90
|
+
grainFreq: .18,
|
|
91
|
+
grainScale: 1.8,
|
|
92
|
+
octaves: 4,
|
|
93
|
+
roughness: 1.4,
|
|
94
|
+
wobble: 2.6,
|
|
95
|
+
segments: 13,
|
|
96
|
+
cap: "round"
|
|
97
|
+
},
|
|
75
98
|
marker: {
|
|
76
99
|
weight: 12,
|
|
77
100
|
weightJitter: .2,
|
|
@@ -147,44 +170,44 @@ var T = {
|
|
|
147
170
|
segments: Math.max(2, Math.round(r(e.segments, t.segments))),
|
|
148
171
|
cap: i(e.cap, t.cap)
|
|
149
172
|
};
|
|
150
|
-
}, O = 100, k = 40;
|
|
151
|
-
function
|
|
152
|
-
let
|
|
173
|
+
}, O = 100, k = 40, A = .06;
|
|
174
|
+
function j(e, t, n = null, r = null) {
|
|
175
|
+
let i = n ? n.x : 4, a = n ? n.x + n.w : 96, o = n ? n.y + n.h / 2 : 40 / 2, s = n ? n.y + n.h * .92 : r == null ? 32 : 40 * (r + A), c = t.seed ?? 1, l = (e, n, r, i, a = 0) => w(e, n, r, i, {
|
|
153
176
|
...t,
|
|
154
|
-
seed:
|
|
177
|
+
seed: c + a
|
|
155
178
|
});
|
|
156
179
|
switch (e) {
|
|
157
180
|
case "underline": return {
|
|
158
|
-
lines: [
|
|
181
|
+
lines: [l(i, s, a, s)],
|
|
159
182
|
closed: !1
|
|
160
183
|
};
|
|
161
184
|
case "strikethrough": return {
|
|
162
|
-
lines: [
|
|
185
|
+
lines: [l(i, o, a, o)],
|
|
163
186
|
closed: !1
|
|
164
187
|
};
|
|
165
188
|
case "highlight": return {
|
|
166
|
-
lines: [
|
|
189
|
+
lines: [l(i, o, a, o)],
|
|
167
190
|
closed: !1
|
|
168
191
|
};
|
|
169
192
|
case "box": {
|
|
170
193
|
let e = n ? n.y : 4, t = n ? n.y + n.h : 36;
|
|
171
194
|
return {
|
|
172
195
|
lines: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
196
|
+
l(i, e, a, e, 0),
|
|
197
|
+
l(a, e, a, t, 1),
|
|
198
|
+
l(a, t, i, t, 2),
|
|
199
|
+
l(i, t, i, e, 3)
|
|
177
200
|
],
|
|
178
201
|
closed: !1
|
|
179
202
|
};
|
|
180
203
|
}
|
|
181
204
|
case "bracket": {
|
|
182
|
-
let e = n ? n.y : 4, t = n ? n.y + n.h : 36,
|
|
205
|
+
let e = n ? n.y : 4, t = n ? n.y + n.h : 36, r = (a - i) * .22;
|
|
183
206
|
return {
|
|
184
207
|
lines: [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
208
|
+
l(i + r, e, i, e, 0),
|
|
209
|
+
l(i, e, i, t, 1),
|
|
210
|
+
l(i, t, i + r, t, 2)
|
|
188
211
|
],
|
|
189
212
|
closed: !1
|
|
190
213
|
};
|
|
@@ -198,28 +221,28 @@ function A(e, t, n = null) {
|
|
|
198
221
|
closed: !1
|
|
199
222
|
};
|
|
200
223
|
default: return {
|
|
201
|
-
lines: [
|
|
224
|
+
lines: [l(i, s, a, s)],
|
|
202
225
|
closed: !1
|
|
203
226
|
};
|
|
204
227
|
}
|
|
205
228
|
}
|
|
206
|
-
function
|
|
229
|
+
function M({ lines: e, closed: t }, n, r) {
|
|
207
230
|
return e.map((e, i) => {
|
|
208
231
|
if (t) return x(e, n, r + i);
|
|
209
232
|
let a = e[0], o = e[e.length - 1];
|
|
210
233
|
return b(e, a[0], a[1], o[0], o[1], n, r + i);
|
|
211
234
|
});
|
|
212
235
|
}
|
|
213
|
-
function
|
|
236
|
+
function N(e, t = !1) {
|
|
214
237
|
return e.map((e) => t ? S(e) : _(e)).join(" ");
|
|
215
238
|
}
|
|
216
239
|
//#endregion
|
|
217
240
|
//#region src/components/custom/handmark/freehand.ts
|
|
218
|
-
var
|
|
241
|
+
var P = (e, t) => [e[0] + t[0], e[1] + t[1]], F = (e, t) => [e[0] - t[0], e[1] - t[1]], I = (e, t) => [e[0] * t, e[1] * t], L = (e) => [-e[0], -e[1]], R = (e) => [e[1], -e[0]], z = (e, t) => e[0] * t[0] + e[1] * t[1], B = (e) => e[0] * e[0] + e[1] * e[1], V = (e, t) => B(F(e, t)), H = (e, t) => Math.hypot(e[1] - t[1], e[0] - t[0]), U = (e) => I(e, 1 / (Math.hypot(e[0], e[1]) || 1)), W = (e, t, n) => P(e, I(F(t, e), n)), G = (e, t) => I(P(e, t), .5), K = (e, t, n) => {
|
|
219
242
|
let r = Math.sin(n), i = Math.cos(n), a = e[0] - t[0], o = e[1] - t[1];
|
|
220
243
|
return [a * i - o * r + t[0], a * r + o * i + t[1]];
|
|
221
|
-
}, { min:
|
|
222
|
-
function
|
|
244
|
+
}, { min: q, PI: ee } = Math, J = ee + 1e-4, Y = (e) => e;
|
|
245
|
+
function X(e, t = {}) {
|
|
223
246
|
let { streamline: n = .5, size: r = 16, last: i = !1 } = t;
|
|
224
247
|
if (e.length === 0) return [];
|
|
225
248
|
let a = .15 + (1 - n) * .85, o = e.map((e) => [
|
|
@@ -229,9 +252,9 @@ function J(e, t = {}) {
|
|
|
229
252
|
]);
|
|
230
253
|
if (o.length === 2) {
|
|
231
254
|
let e = o[1];
|
|
232
|
-
o[1] =
|
|
255
|
+
o[1] = W(o[0], e, .5), o.push(e);
|
|
233
256
|
}
|
|
234
|
-
o.length === 1 && o.push([...
|
|
257
|
+
o.length === 1 && o.push([...P(o[0], [1, 1]), ...o[0].slice(2)]);
|
|
235
258
|
let s = [{
|
|
236
259
|
point: [o[0][0], o[0][1]],
|
|
237
260
|
pressure: o[0][2] >= 0 ? o[0][2] : .25,
|
|
@@ -240,9 +263,9 @@ function J(e, t = {}) {
|
|
|
240
263
|
runningLength: 0
|
|
241
264
|
}], c = !1, l = 0, u = s[0], d = o.length - 1;
|
|
242
265
|
for (let e = 1; e < o.length; e++) {
|
|
243
|
-
let t = i && e === d ? [o[e][0], o[e][1]] :
|
|
244
|
-
if (
|
|
245
|
-
let n =
|
|
266
|
+
let t = i && e === d ? [o[e][0], o[e][1]] : W(u.point, [o[e][0], o[e][1]], a);
|
|
267
|
+
if (V(u.point, t) < 1e-4) continue;
|
|
268
|
+
let n = H(t, u.point);
|
|
246
269
|
if (l += n, e < d && !c) {
|
|
247
270
|
if (l < r) continue;
|
|
248
271
|
c = !0;
|
|
@@ -250,94 +273,94 @@ function J(e, t = {}) {
|
|
|
250
273
|
u = {
|
|
251
274
|
point: t,
|
|
252
275
|
pressure: o[e][2] >= 0 ? o[e][2] : .5,
|
|
253
|
-
vector:
|
|
276
|
+
vector: U(F(u.point, t)),
|
|
254
277
|
distance: n,
|
|
255
278
|
runningLength: l
|
|
256
279
|
}, s.push(u);
|
|
257
280
|
}
|
|
258
281
|
return s.length > 0 && (s[0].vector = s[1]?.vector ?? [0, 0]), s;
|
|
259
282
|
}
|
|
260
|
-
function
|
|
261
|
-
let { size: n = 16, smoothing: r = .5, thinning: i = .5, simulatePressure: a = !0, easing: o =
|
|
283
|
+
function te(e, t = {}) {
|
|
284
|
+
let { size: n = 16, smoothing: r = .5, thinning: i = .5, simulatePressure: a = !0, easing: o = Y, start: s = {}, end: c = {}, last: l = !1 } = t, { cap: u = !0, easing: d = (e) => e * (2 - e) } = s, { cap: f = !0, easing: p = (e) => --e * e * e + 1 } = c;
|
|
262
285
|
if (e.length === 0 || n <= 0) return [];
|
|
263
286
|
let m = e[e.length - 1].runningLength, h = s.taper === !1 ? 0 : s.taper === !0 ? Math.max(n, m) : s.taper ?? 0, g = c.taper === !1 ? 0 : c.taper === !0 ? Math.max(n, m) : c.taper ?? 0, _ = (n * r) ** 2, v = [], y = [], b = [], x = e.slice(0, 10).reduce((e, t) => {
|
|
264
287
|
let r = t.pressure;
|
|
265
288
|
if (a) {
|
|
266
|
-
let i =
|
|
267
|
-
r =
|
|
289
|
+
let i = q(1, t.distance / n);
|
|
290
|
+
r = q(1, e + (q(1, 1 - i) - e) * (i * .275));
|
|
268
291
|
}
|
|
269
292
|
return (e + r) / 2;
|
|
270
|
-
}, e[0].pressure), S =
|
|
293
|
+
}, e[0].pressure), S = Z(n, i, e[e.length - 1].pressure, o), C, w = e[0].vector, T = e[0].point, E = T, D = T, O = E, k = !1;
|
|
271
294
|
for (let t = 0; t < e.length; t++) {
|
|
272
295
|
let { pressure: r } = e[t], { point: s, vector: c, distance: l, runningLength: u } = e[t];
|
|
273
296
|
if (t < e.length - 1 && m - u < 3) continue;
|
|
274
297
|
if (i) {
|
|
275
298
|
if (a) {
|
|
276
|
-
let e =
|
|
277
|
-
r =
|
|
299
|
+
let e = q(1, l / n), t = q(1, 1 - e);
|
|
300
|
+
r = q(1, x + (t - x) * (e * .275));
|
|
278
301
|
}
|
|
279
|
-
S =
|
|
302
|
+
S = Z(n, i, r, o);
|
|
280
303
|
} else S = n / 2;
|
|
281
304
|
C === void 0 && (C = S);
|
|
282
305
|
let f = u < h ? d(u / h) : 1, A = m - u < g ? p((m - u) / g) : 1;
|
|
283
306
|
S = Math.max(.01, S * Math.min(f, A));
|
|
284
|
-
let j = (t < e.length - 1 ? e[t + 1] : e[t]).vector, M = t < e.length - 1 ?
|
|
285
|
-
if (
|
|
286
|
-
let e =
|
|
287
|
-
for (let t = 0; t <= 1; t += .07692307692307693) D =
|
|
288
|
-
T = D, E = O,
|
|
307
|
+
let j = (t < e.length - 1 ? e[t + 1] : e[t]).vector, M = t < e.length - 1 ? z(c, j) : 1, N = z(c, w) < 0 && !k, L = M !== null && M < .2;
|
|
308
|
+
if (N || L) {
|
|
309
|
+
let e = I(R(w), S);
|
|
310
|
+
for (let t = 0; t <= 1; t += .07692307692307693) D = K(F(s, e), s, J * t), v.push(D), O = K(P(s, e), s, J * -t), y.push(O);
|
|
311
|
+
T = D, E = O, L && (k = !0);
|
|
289
312
|
continue;
|
|
290
313
|
}
|
|
291
314
|
if (k = !1, t === e.length - 1) {
|
|
292
|
-
let e =
|
|
293
|
-
v.push(
|
|
315
|
+
let e = I(R(c), S);
|
|
316
|
+
v.push(F(s, e)), y.push(P(s, e));
|
|
294
317
|
continue;
|
|
295
318
|
}
|
|
296
|
-
let
|
|
297
|
-
D =
|
|
319
|
+
let B = I(R(W(j, c, M)), S);
|
|
320
|
+
D = F(s, B), (t <= 1 || V(T, D) > _) && (v.push(D), T = D), O = P(s, B), (t <= 1 || V(E, O) > _) && (y.push(O), E = O), x = r, w = c, b.push(S);
|
|
298
321
|
}
|
|
299
|
-
let A = e[0].point.slice(0, 2), j = e.length > 1 ? e[e.length - 1].point.slice(0, 2) :
|
|
322
|
+
let A = e[0].point.slice(0, 2), j = e.length > 1 ? e[e.length - 1].point.slice(0, 2) : P(e[0].point, [1, 1]), M = [], N = [];
|
|
300
323
|
if (e.length === 1) {
|
|
301
324
|
if (!(h || g) || l) {
|
|
302
|
-
let e =
|
|
303
|
-
for (let n = 1 / 13, r = n; r <= 1; r += n) t.push(
|
|
325
|
+
let e = P(A, I(U(R(F(A, j))), -(C ?? S))), t = [];
|
|
326
|
+
for (let n = 1 / 13, r = n; r <= 1; r += n) t.push(K(e, A, J * 2 * r));
|
|
304
327
|
return t;
|
|
305
328
|
}
|
|
306
329
|
} else {
|
|
307
330
|
if (!(h || g && e.length === 1)) if (u) for (let e = 1 / 13, t = e; t <= 1; t += e) {
|
|
308
|
-
let e =
|
|
331
|
+
let e = K(y[0], A, J * t);
|
|
309
332
|
M.push(e);
|
|
310
333
|
}
|
|
311
334
|
else {
|
|
312
|
-
let e =
|
|
313
|
-
M.push(
|
|
335
|
+
let e = F(v[0], y[0]), t = I(e, .5), n = I(e, .51);
|
|
336
|
+
M.push(F(A, t), F(A, n), P(A, n), P(A, t));
|
|
314
337
|
}
|
|
315
|
-
let t = L(
|
|
316
|
-
if (g || h && e.length === 1)
|
|
338
|
+
let t = R(L(e[e.length - 1].vector));
|
|
339
|
+
if (g || h && e.length === 1) N.push(j);
|
|
317
340
|
else if (f) {
|
|
318
|
-
let e =
|
|
319
|
-
for (let t = 1 / 29, n = t; n < 1; n += t)
|
|
320
|
-
} else
|
|
341
|
+
let e = P(j, I(t, S));
|
|
342
|
+
for (let t = 1 / 29, n = t; n < 1; n += t) N.push(K(e, j, J * 3 * n));
|
|
343
|
+
} else N.push(P(j, I(t, S)), P(j, I(t, S * .99)), F(j, I(t, S * .99)), F(j, I(t, S)));
|
|
321
344
|
}
|
|
322
|
-
return v.concat(
|
|
345
|
+
return v.concat(N, y.reverse(), M);
|
|
323
346
|
}
|
|
324
|
-
function
|
|
347
|
+
function Z(e, t, n, r = Y) {
|
|
325
348
|
if (!t) return e / 2;
|
|
326
349
|
let i = n;
|
|
327
350
|
return i < 0 && (i = 0), i > 1 && (i = 1), e * r(.5 - t * (.5 - i)) * .5 + e / 2 * (1 - Math.abs(t));
|
|
328
351
|
}
|
|
329
|
-
function
|
|
330
|
-
return
|
|
352
|
+
function Q(e, t = {}) {
|
|
353
|
+
return te(X(e, t), t);
|
|
331
354
|
}
|
|
332
|
-
function
|
|
355
|
+
function ne(e, t = !0) {
|
|
333
356
|
if (e.length < 4) return "";
|
|
334
|
-
let n = e[0], r = e[1], i = e[2], a = `M${n[0].toFixed(2)},${n[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${
|
|
335
|
-
for (let t = 2, i = e.length - 1; t < i; t++) n = e[t], r = e[t + 1], a += `${
|
|
357
|
+
let n = e[0], r = e[1], i = e[2], a = `M${n[0].toFixed(2)},${n[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${G(r, i)[0].toFixed(2)},${G(r, i)[1].toFixed(2)} T`;
|
|
358
|
+
for (let t = 2, i = e.length - 1; t < i; t++) n = e[t], r = e[t + 1], a += `${G(n, r)[0].toFixed(2)},${G(n, r)[1].toFixed(2)} `;
|
|
336
359
|
return t && (a += "Z"), a;
|
|
337
360
|
}
|
|
338
361
|
//#endregion
|
|
339
362
|
//#region src/components/custom/handmark/texture.ts
|
|
340
|
-
function
|
|
363
|
+
function re(e, t, n) {
|
|
341
364
|
if (t.grain <= 0 && t.grainScale <= 0) return "";
|
|
342
365
|
let r = (n ^ 34283) & 65535, i = (.55 - t.grain * .42).toFixed(3), a = t.grain > 0 ? "in" : "over";
|
|
343
366
|
return `
|
|
@@ -356,12 +379,12 @@ function $(e) {
|
|
|
356
379
|
}
|
|
357
380
|
//#endregion
|
|
358
381
|
//#region src/components/custom/handmark/ink.ts
|
|
359
|
-
function
|
|
382
|
+
function ie(e) {
|
|
360
383
|
let t = 0;
|
|
361
384
|
for (let n = 1; n < e.length; n++) t += Math.hypot(e[n][0] - e[n - 1][0], e[n][1] - e[n - 1][1]);
|
|
362
385
|
return t;
|
|
363
386
|
}
|
|
364
|
-
function
|
|
387
|
+
function ae(e, t, n) {
|
|
365
388
|
let r = y(n);
|
|
366
389
|
return e.map((n, i) => {
|
|
367
390
|
let a = i / Math.max(1, e.length - 1), o = .5 + .35 * Math.sin(Math.PI * a) + (r() - .5) * t.weightJitter * .4;
|
|
@@ -372,17 +395,17 @@ function ie(e, t, n) {
|
|
|
372
395
|
];
|
|
373
396
|
});
|
|
374
397
|
}
|
|
375
|
-
function
|
|
398
|
+
function oe(e) {
|
|
376
399
|
return e === "out-cubic" ? (e) => 1 - (1 - e) ** 3 : (e) => e;
|
|
377
400
|
}
|
|
378
|
-
function
|
|
401
|
+
function se(e, t, n, r, i, a = !1) {
|
|
379
402
|
if (t.stamp) {
|
|
380
403
|
let i = y(n), a = t.stamp({
|
|
381
404
|
centerline: e,
|
|
382
405
|
brush: t,
|
|
383
406
|
rng: i,
|
|
384
407
|
seed: n,
|
|
385
|
-
length:
|
|
408
|
+
length: ie(e),
|
|
386
409
|
color: r
|
|
387
410
|
});
|
|
388
411
|
return {
|
|
@@ -395,22 +418,22 @@ function oe(e, t, n, r, i, a = !1) {
|
|
|
395
418
|
for (let i = 0; i < t.passes; i++) {
|
|
396
419
|
let a = e[0], c = e[e.length - 1], l = b(e, a[0], a[1], c[0], c[1], t.weight * .06, n + 991 * i), u = t.opacity * (1 - t.passOpacity * i);
|
|
397
420
|
if (t.ribbon === "hull") {
|
|
398
|
-
let e =
|
|
421
|
+
let e = Q(ae(l, t, n + 7 * i), {
|
|
399
422
|
size: t.weight,
|
|
400
423
|
thinning: t.thinning,
|
|
401
424
|
streamline: Math.max(.1, .55 - t.roughness * .1),
|
|
402
425
|
last: !0,
|
|
403
426
|
start: {
|
|
404
427
|
taper: t.taper.start,
|
|
405
|
-
easing:
|
|
428
|
+
easing: oe(t.taper.ease)
|
|
406
429
|
},
|
|
407
430
|
end: {
|
|
408
431
|
taper: t.taper.end,
|
|
409
|
-
easing:
|
|
432
|
+
easing: oe(t.taper.ease)
|
|
410
433
|
}
|
|
411
434
|
});
|
|
412
435
|
o.push({
|
|
413
|
-
d:
|
|
436
|
+
d: ne(e),
|
|
414
437
|
fill: r,
|
|
415
438
|
opacity: u,
|
|
416
439
|
blend: t.blend
|
|
@@ -422,7 +445,7 @@ function oe(e, t, n, r, i, a = !1) {
|
|
|
422
445
|
blend: t.blend
|
|
423
446
|
});
|
|
424
447
|
}
|
|
425
|
-
let c = $(t) ?
|
|
448
|
+
let c = $(t) ? re(i, t, n) : "";
|
|
426
449
|
return {
|
|
427
450
|
paths: o,
|
|
428
451
|
filterId: c ? i : null,
|
|
@@ -431,7 +454,12 @@ function oe(e, t, n, r, i, a = !1) {
|
|
|
431
454
|
}
|
|
432
455
|
//#endregion
|
|
433
456
|
//#region src/components/custom/handmark/useHandMark.ts
|
|
434
|
-
|
|
457
|
+
var ce = {
|
|
458
|
+
currentFrame: d(0),
|
|
459
|
+
start: () => {},
|
|
460
|
+
stop: () => {}
|
|
461
|
+
};
|
|
462
|
+
function le(e, t, n = null) {
|
|
435
463
|
return {
|
|
436
464
|
brush: e.brush ?? "pen",
|
|
437
465
|
shape: e.shape ?? "underline",
|
|
@@ -446,27 +474,28 @@ function se(e, t) {
|
|
|
446
474
|
jagged: e.jagged ?? !1,
|
|
447
475
|
box: e.box ?? null,
|
|
448
476
|
path: e.path ?? null,
|
|
449
|
-
filterId: t
|
|
477
|
+
filterId: t,
|
|
478
|
+
baselineFrac: n
|
|
450
479
|
};
|
|
451
480
|
}
|
|
452
|
-
function
|
|
481
|
+
function ue(e) {
|
|
453
482
|
let t = n(() => {
|
|
454
483
|
let t = { ...e.value.overrides ?? {} };
|
|
455
484
|
return e.value.roughness != null && (t.roughness = e.value.roughness), e.value.segments != null && (t.segments = e.value.segments), E(e.value.brush, t);
|
|
456
|
-
}), r = n(() => $(t.value)), i = n(() =>
|
|
485
|
+
}), r = n(() => $(t.value)), i = n(() => j(e.value.shape, {
|
|
457
486
|
roughness: t.value.roughness,
|
|
458
487
|
segments: t.value.segments,
|
|
459
488
|
seed: e.value.seed,
|
|
460
489
|
jagged: e.value.jagged
|
|
461
|
-
}, e.value.box)), a = n(() => e.value.animation === "boil" || e.value.animation === "draw-then-boil"), o = n(() => e.value.animation === "draw-on" || e.value.animation === "draw-then-boil"), s = n(() => r.value ? "clip" : "dashoffset"), c = d(!1), l = C(() => a.value && c.value ? e.value.boilFrames : 1, () => Math.max(16, 1e3 / e.value.boilFps)), u = n(() => {
|
|
490
|
+
}, e.value.box, e.value.baselineFrac)), a = n(() => e.value.animation === "boil" || e.value.animation === "draw-then-boil"), o = n(() => e.value.animation === "draw-on" || e.value.animation === "draw-then-boil"), s = n(() => r.value ? "clip" : "dashoffset"), c = d(!1), l = e.value.animation === "boil" || e.value.animation === "draw-then-boil" ? C(() => a.value && c.value ? e.value.boilFrames : 1, () => Math.max(16, 1e3 / e.value.boilFps)) : ce, u = n(() => {
|
|
462
491
|
if (e.value.path) return e.value.path;
|
|
463
492
|
let n = i.value.lines;
|
|
464
493
|
if (a.value && c.value) {
|
|
465
494
|
let r = t.value.wobble * .4 + .4, a = l.currentFrame.value;
|
|
466
|
-
n =
|
|
495
|
+
n = M(i.value, r, e.value.seed + a * 31);
|
|
467
496
|
}
|
|
468
|
-
return
|
|
469
|
-
}), f = n(() => e.value.path ? [] : a.value && c.value ?
|
|
497
|
+
return N(n, e.value.jagged);
|
|
498
|
+
}), f = n(() => e.value.path ? [] : a.value && c.value ? M(i.value, t.value.wobble * .4 + .4, e.value.seed + l.currentFrame.value * 31) : i.value.lines);
|
|
470
499
|
return {
|
|
471
500
|
brush: t,
|
|
472
501
|
baseGeom: i,
|
|
@@ -477,7 +506,7 @@ function ce(e) {
|
|
|
477
506
|
defs: []
|
|
478
507
|
}, r = f.value.length ? f.value : [[]];
|
|
479
508
|
for (let i of r) {
|
|
480
|
-
let r =
|
|
509
|
+
let r = se(i, t.value, e.value.seed, e.value.color, e.value.filterId, e.value.jagged);
|
|
481
510
|
n.paths.push(...r.paths), r.filterId && !n.filterId && (n.filterId = r.filterId, n.defs = r.defs);
|
|
482
511
|
}
|
|
483
512
|
return n;
|
|
@@ -493,11 +522,11 @@ function ce(e) {
|
|
|
493
522
|
}
|
|
494
523
|
//#endregion
|
|
495
524
|
//#region src/components/custom/handmark/HandMark.vue?vue&type=script&setup=true&lang.ts
|
|
496
|
-
var
|
|
525
|
+
var de = [
|
|
497
526
|
"data-shape",
|
|
498
527
|
"data-behind",
|
|
499
528
|
"data-grained"
|
|
500
|
-
],
|
|
529
|
+
], fe = ["viewBox"], pe = ["innerHTML"], me = [
|
|
501
530
|
"d",
|
|
502
531
|
"stroke",
|
|
503
532
|
"fill",
|
|
@@ -505,7 +534,7 @@ var le = [
|
|
|
505
534
|
"stroke-opacity",
|
|
506
535
|
"fill-opacity",
|
|
507
536
|
"filter"
|
|
508
|
-
],
|
|
537
|
+
], he = 100, ge = 40, _e = /* @__PURE__ */ e(/* @__PURE__ */ a({
|
|
509
538
|
__name: "HandMark",
|
|
510
539
|
props: {
|
|
511
540
|
brush: { default: "pen" },
|
|
@@ -530,80 +559,104 @@ var le = [
|
|
|
530
559
|
points: {}
|
|
531
560
|
},
|
|
532
561
|
setup(e, { expose: a }) {
|
|
533
|
-
let _ = e, v = `hm-${h().replace(/[^a-zA-Z0-9_-]/g, "")}`, { brush:
|
|
534
|
-
function M() {
|
|
535
|
-
w.value && (E.value = !0, T.start());
|
|
536
|
-
}
|
|
562
|
+
let _ = e, v = `hm-${h().replace(/[^a-zA-Z0-9_-]/g, "")}`, y = d(null), { brush: b, fragment: x, grained: S, drawKind: C, draws: w, boils: T, boil: E, boilArmed: D } = ue(n(() => le(_, v, y.value))), O = n(() => _.shape === "highlight"), k = n(() => _.path ?? null), A = d(!1), j = d(null), M = n(() => w.value ? `${C.value === "clip" ? "clip-path" : "stroke-dashoffset"} ${_.drawMs}ms cubic-bezier(.16,1,.3,1) ${_.drawDelayMs}ms` : "none");
|
|
537
563
|
function N() {
|
|
538
|
-
|
|
539
|
-
|
|
564
|
+
T.value && (D.value = !0, E.start());
|
|
565
|
+
}
|
|
566
|
+
function P() {
|
|
567
|
+
if (!w.value) {
|
|
568
|
+
N();
|
|
540
569
|
return;
|
|
541
570
|
}
|
|
542
|
-
|
|
543
|
-
|
|
571
|
+
A.value = !1, j.value && j.value.offsetWidth, requestAnimationFrame(() => {
|
|
572
|
+
A.value = !0;
|
|
544
573
|
});
|
|
545
574
|
}
|
|
546
|
-
function
|
|
547
|
-
_.animation === "draw-then-boil" &&
|
|
575
|
+
function F() {
|
|
576
|
+
_.animation === "draw-then-boil" && N();
|
|
548
577
|
}
|
|
549
|
-
a({ play:
|
|
550
|
-
let
|
|
578
|
+
a({ play: P });
|
|
579
|
+
let I = n(() => _.box == null && (_.shape === "underline" || _.shape === "strikethrough"));
|
|
580
|
+
function L(e) {
|
|
581
|
+
if (typeof document > "u" || typeof Range > "u") return null;
|
|
582
|
+
let t = document.createRange(), n = !1;
|
|
583
|
+
for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && r.tagName === "svg" || (t.selectNode(r), n = !0);
|
|
584
|
+
if (!n) return null;
|
|
585
|
+
let r = t.getBoundingClientRect();
|
|
586
|
+
return t.detach?.(), r.height > 0 ? r : null;
|
|
587
|
+
}
|
|
588
|
+
function R() {
|
|
589
|
+
if (!I.value) return;
|
|
590
|
+
let e = j.value;
|
|
591
|
+
if (!e) return;
|
|
592
|
+
let t = L(e);
|
|
593
|
+
if (!t) return;
|
|
594
|
+
let n = e.getBoundingClientRect();
|
|
595
|
+
if (n.height <= 0) return;
|
|
596
|
+
let r = (t.bottom - n.top) / n.height;
|
|
597
|
+
y.value = Math.min(1, Math.max(0, r));
|
|
598
|
+
}
|
|
599
|
+
let z = null;
|
|
600
|
+
function B() {
|
|
601
|
+
!I.value || !j.value || (R(), typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(() => R()), typeof ResizeObserver < "u" && (z = new ResizeObserver(() => R()), z.observe(j.value)));
|
|
602
|
+
}
|
|
603
|
+
let V = null;
|
|
551
604
|
l(() => {
|
|
552
|
-
_.animation === "boil" &&
|
|
553
|
-
e.some((e) => e.isIntersecting) && (
|
|
554
|
-
}, { threshold: .35 }),
|
|
605
|
+
B(), _.animation === "boil" && N(), _.appear === "mount" ? P() : _.appear === "visible" && typeof IntersectionObserver < "u" ? (V = new IntersectionObserver((e) => {
|
|
606
|
+
e.some((e) => e.isIntersecting) && (P(), V?.disconnect());
|
|
607
|
+
}, { threshold: .35 }), j.value && V.observe(j.value)) : _.appear === "visible" && P();
|
|
555
608
|
}), c(() => {
|
|
556
|
-
|
|
609
|
+
V?.disconnect(), z?.disconnect(), E.stop();
|
|
557
610
|
}), g(() => _.animation, () => {
|
|
558
|
-
|
|
611
|
+
A.value = !1, D.value = !1;
|
|
559
612
|
});
|
|
560
|
-
let
|
|
613
|
+
let H = {
|
|
561
614
|
"source-over": "normal",
|
|
562
615
|
multiply: "multiply",
|
|
563
616
|
darken: "darken",
|
|
564
617
|
screen: "screen"
|
|
565
618
|
};
|
|
566
|
-
function
|
|
619
|
+
function U(e) {
|
|
567
620
|
return {
|
|
568
|
-
mixBlendMode:
|
|
569
|
-
transition:
|
|
621
|
+
mixBlendMode: H[e],
|
|
622
|
+
transition: M.value
|
|
570
623
|
};
|
|
571
624
|
}
|
|
572
625
|
return (n, a) => (u(), i("span", {
|
|
573
626
|
class: "hm",
|
|
574
627
|
ref_key: "root",
|
|
575
|
-
ref:
|
|
628
|
+
ref: j,
|
|
576
629
|
"data-shape": e.shape,
|
|
577
|
-
"data-behind":
|
|
578
|
-
"data-grained": m(
|
|
630
|
+
"data-behind": O.value,
|
|
631
|
+
"data-grained": m(S)
|
|
579
632
|
}, [p(n.$slots, "default", {}, void 0, !0), (u(), i("svg", {
|
|
580
633
|
class: "hm__svg",
|
|
581
|
-
viewBox: `0 0 ${
|
|
634
|
+
viewBox: `0 0 ${he} ${ge}`,
|
|
582
635
|
preserveAspectRatio: "none",
|
|
583
636
|
"aria-hidden": "true",
|
|
584
637
|
focusable: "false"
|
|
585
|
-
}, [m(
|
|
638
|
+
}, [m(x).filterId ? (u(), i("defs", {
|
|
586
639
|
key: 0,
|
|
587
|
-
innerHTML: m(
|
|
588
|
-
}, null, 8,
|
|
640
|
+
innerHTML: m(x).defs[0]
|
|
641
|
+
}, null, 8, pe)) : r("", !0), (u(!0), i(t, null, f(m(x).paths, (e, t) => (u(), i("path", {
|
|
589
642
|
key: t,
|
|
590
643
|
class: o(["hm__path", {
|
|
591
|
-
drawn:
|
|
592
|
-
[`hm__path--${m(
|
|
644
|
+
drawn: A.value,
|
|
645
|
+
[`hm__path--${m(C)}`]: m(w)
|
|
593
646
|
}]),
|
|
594
|
-
d:
|
|
647
|
+
d: k.value ?? e.d,
|
|
595
648
|
pathLength: "1",
|
|
596
649
|
"vector-effect": "non-scaling-stroke",
|
|
597
650
|
stroke: e.stroke ?? "none",
|
|
598
651
|
fill: e.fill ?? "none",
|
|
599
|
-
"stroke-width": e.stroke ? m(
|
|
652
|
+
"stroke-width": e.stroke ? m(b).weight : 0,
|
|
600
653
|
"stroke-opacity": e.stroke ? e.opacity : void 0,
|
|
601
654
|
"fill-opacity": e.fill ? e.opacity : void 0,
|
|
602
|
-
filter: m(
|
|
603
|
-
style: s(
|
|
604
|
-
onTransitionend:
|
|
605
|
-
}, null, 46,
|
|
655
|
+
filter: m(x).filterId ? `url(#${m(x).filterId})` : void 0,
|
|
656
|
+
style: s(U(e.blend)),
|
|
657
|
+
onTransitionend: F
|
|
658
|
+
}, null, 46, me))), 128))], 8, fe))], 8, de));
|
|
606
659
|
}
|
|
607
|
-
}), [["__scopeId", "data-v-
|
|
660
|
+
}), [["__scopeId", "data-v-581c26dd"]]);
|
|
608
661
|
//#endregion
|
|
609
|
-
export { T as BRUSHES,
|
|
662
|
+
export { T as BRUSHES, _e as HandMark, _e as InkMark, A as UNDERLINE_GAP, k as VB_H, O as VB_W, M as boilLines, Q as getStroke, X as getStrokePoints, ne as getSvgPathFromStroke, re as grainFilter, $ as hasGrain, se as ink, D as lerpBrush, le as normalizeProps, E as resolveBrush, N as serialize, j as shapeGeom, ue as useHandMark };
|
package/dist/labeled-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
2
|
import { a as t, i as n, o as r, r as i, s as a } from "./SelectScrollDownButton-T32cVFeM.js";
|
|
3
3
|
import { t as o } from "./SelectGroup-BFiod7X2.js";
|
|
4
|
-
import { n as s } from "./slider-
|
|
4
|
+
import { n as s } from "./slider-ClgpP7EB.js";
|
|
5
5
|
import { t as c } from "./Switch-Ch-k3Rv-.js";
|
|
6
6
|
import { t as l } from "./Input-xuDwALQR.js";
|
|
7
7
|
import { t as u } from "./IconTooltip-Cus0fvK0.js";
|
|
@@ -66,6 +66,19 @@ var e = 6, t = 8, n = {
|
|
|
66
66
|
saturation: 1,
|
|
67
67
|
paperGrain: .008,
|
|
68
68
|
alpha: 1
|
|
69
|
+
}, r = {
|
|
70
|
+
medium: "crayon",
|
|
71
|
+
strokeOrient: "tensor",
|
|
72
|
+
granulation: .3,
|
|
73
|
+
canvasGrain: .5,
|
|
74
|
+
strokeAmount: .35,
|
|
75
|
+
strokeAnisotropy: .5,
|
|
76
|
+
strokeLayers: 1,
|
|
77
|
+
impasto: 0,
|
|
78
|
+
brokenColor: 0,
|
|
79
|
+
wetEdge: 0,
|
|
80
|
+
saturation: .92,
|
|
81
|
+
paperGrain: .008
|
|
69
82
|
};
|
|
70
83
|
//#endregion
|
|
71
|
-
export { e as n, t as r, n as t };
|
|
84
|
+
export { r as i, e as n, t as r, n as t };
|
|
@@ -121,7 +121,7 @@ var T = /* @__PURE__ */ t(/* @__PURE__ */ l({
|
|
|
121
121
|
"data-touch-active"
|
|
122
122
|
]));
|
|
123
123
|
}
|
|
124
|
-
}), [["__scopeId", "data-v-
|
|
124
|
+
}), [["__scopeId", "data-v-394270d4"]]), E = C("glass-slider focus-ring relative flex w-full touch-none select-none items-center transition-colors", {
|
|
125
125
|
variants: {
|
|
126
126
|
variant: {
|
|
127
127
|
standard: "",
|
package/dist/slider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./slider-
|
|
1
|
+
import { n as e, t } from "./slider-ClgpP7EB.js";
|
|
2
2
|
export { e as Slider, t as sliderVariants };
|