@atme-lab/ui-kit 0.1.19 → 0.1.20
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/index.cjs10.js +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs13.js +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs30.js +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs38.js +1 -1
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs385.js +1 -1
- package/dist/index.cjs386.js +1 -1
- package/dist/index.cjs386.js.map +1 -1
- package/dist/index.cjs387.js +1 -1
- package/dist/index.cjs387.js.map +1 -1
- package/dist/index.cjs388.js +1 -1
- package/dist/index.cjs388.js.map +1 -1
- package/dist/index.cjs389.js +1 -1
- package/dist/index.cjs389.js.map +1 -1
- package/dist/index.cjs39.js +1 -1
- package/dist/index.cjs390.js +1 -1
- package/dist/index.cjs390.js.map +1 -1
- package/dist/index.cjs391.js +1 -1
- package/dist/index.cjs391.js.map +1 -1
- package/dist/index.cjs392.js +1 -1
- package/dist/index.cjs392.js.map +1 -1
- package/dist/index.cjs40.js +1 -9
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -22
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +9 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs420.js +1 -1
- package/dist/index.cjs421.js +1 -1
- package/dist/index.cjs422.js +1 -1
- package/dist/index.cjs423.js +1 -1
- package/dist/index.cjs424.js +1 -1
- package/dist/index.cjs425.js +1 -1
- package/dist/index.cjs426.js +1 -1
- package/dist/index.cjs428.js +1 -1
- package/dist/index.cjs43.js +22 -1
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs430.js +1 -1
- package/dist/index.cjs433.js +1 -1
- package/dist/index.cjs438.js +1 -1
- package/dist/index.cjs438.js.map +1 -1
- package/dist/index.cjs439.js +1 -1
- package/dist/index.cjs439.js.map +1 -1
- package/dist/index.cjs44.js +1 -1
- package/dist/index.cjs440.js +1 -1
- package/dist/index.cjs440.js.map +1 -1
- package/dist/index.cjs441.js +1 -1
- package/dist/index.cjs441.js.map +1 -1
- package/dist/index.cjs442.js +1 -1
- package/dist/index.cjs442.js.map +1 -1
- package/dist/index.cjs443.js +1 -1
- package/dist/index.cjs443.js.map +1 -1
- package/dist/index.cjs444.js +1 -1
- package/dist/index.cjs444.js.map +1 -1
- package/dist/index.cjs445.js +1 -1
- package/dist/index.cjs445.js.map +1 -1
- package/dist/index.cjs446.js +1 -1
- package/dist/index.cjs446.js.map +1 -1
- package/dist/index.cjs447.js +1 -1
- package/dist/index.cjs447.js.map +1 -1
- package/dist/index.cjs448.js +1 -1
- package/dist/index.cjs448.js.map +1 -1
- package/dist/index.cjs449.js +1 -1
- package/dist/index.cjs449.js.map +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs450.js +1 -1
- package/dist/index.cjs450.js.map +1 -1
- package/dist/index.cjs451.js +1 -1
- package/dist/index.cjs451.js.map +1 -1
- package/dist/index.cjs452.js +1 -1
- package/dist/index.cjs452.js.map +1 -1
- package/dist/index.cjs46.js +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs48.js +1 -1
- package/dist/index.cjs48.js.map +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs50.js +1 -1
- package/dist/index.cjs51.js +1 -1
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs52.js.map +1 -1
- package/dist/index.cjs53.js +1 -1
- package/dist/index.cjs53.js.map +1 -1
- package/dist/index.cjs54.js +1 -1
- package/dist/index.cjs54.js.map +1 -1
- package/dist/index.cjs55.js +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs56.js.map +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs58.js +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs59.js.map +1 -1
- package/dist/index.cjs60.js +1 -1
- package/dist/index.cjs60.js.map +1 -1
- package/dist/index.cjs61.js +1 -1
- package/dist/index.cjs62.js +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs64.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs66.js +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs67.js.map +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs69.js.map +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs71.js.map +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs73.js +1 -1
- package/dist/index.cjs73.js.map +1 -1
- package/dist/index.cjs86.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.esm10.js +3 -3
- package/dist/index.esm11.js +2 -2
- package/dist/index.esm12.js +4 -4
- package/dist/index.esm13.js +2 -2
- package/dist/index.esm14.js +2 -2
- package/dist/index.esm15.js +2 -2
- package/dist/index.esm16.js +2 -2
- package/dist/index.esm17.js +2 -2
- package/dist/index.esm18.js +2 -2
- package/dist/index.esm19.js +2 -2
- package/dist/index.esm20.js +2 -2
- package/dist/index.esm21.js +3 -3
- package/dist/index.esm22.js +3 -3
- package/dist/index.esm23.js +2 -2
- package/dist/index.esm24.js +3 -3
- package/dist/index.esm25.js +2 -2
- package/dist/index.esm26.js +2 -2
- package/dist/index.esm27.js +2 -2
- package/dist/index.esm28.js +3 -3
- package/dist/index.esm29.js +2 -2
- package/dist/index.esm30.js +4 -4
- package/dist/index.esm36.js +1 -1
- package/dist/index.esm38.js +5 -8
- package/dist/index.esm38.js.map +1 -1
- package/dist/index.esm385.js +2 -2
- package/dist/index.esm386.js +29 -5
- package/dist/index.esm386.js.map +1 -1
- package/dist/index.esm387.js +24 -25
- package/dist/index.esm387.js.map +1 -1
- package/dist/index.esm388.js +50 -29
- package/dist/index.esm388.js.map +1 -1
- package/dist/index.esm389.js +7 -24
- package/dist/index.esm389.js.map +1 -1
- package/dist/index.esm39.js +41 -2
- package/dist/index.esm39.js.map +1 -1
- package/dist/index.esm390.js +7 -50
- package/dist/index.esm390.js.map +1 -1
- package/dist/index.esm391.js +25 -7
- package/dist/index.esm391.js.map +1 -1
- package/dist/index.esm392.js +5 -7
- package/dist/index.esm392.js.map +1 -1
- package/dist/index.esm40.js +7 -25
- package/dist/index.esm40.js.map +1 -1
- package/dist/index.esm41.js +2 -602
- package/dist/index.esm41.js.map +1 -1
- package/dist/index.esm42.js +26 -5
- package/dist/index.esm42.js.map +1 -1
- package/dist/index.esm420.js +1 -1
- package/dist/index.esm421.js +2 -2
- package/dist/index.esm422.js +3 -3
- package/dist/index.esm423.js +3 -3
- package/dist/index.esm424.js +1 -1
- package/dist/index.esm425.js +2 -2
- package/dist/index.esm426.js +1 -1
- package/dist/index.esm428.js +1 -1
- package/dist/index.esm43.js +602 -65
- package/dist/index.esm43.js.map +1 -1
- package/dist/index.esm430.js +7 -7
- package/dist/index.esm433.js +1 -1
- package/dist/index.esm438.js +18 -5
- package/dist/index.esm438.js.map +1 -1
- package/dist/index.esm439.js +16 -9
- package/dist/index.esm439.js.map +1 -1
- package/dist/index.esm44.js +42 -36
- package/dist/index.esm44.js.map +1 -1
- package/dist/index.esm440.js +11 -6
- package/dist/index.esm440.js.map +1 -1
- package/dist/index.esm441.js +4 -3
- package/dist/index.esm441.js.map +1 -1
- package/dist/index.esm442.js +3 -84
- package/dist/index.esm442.js.map +1 -1
- package/dist/index.esm443.js +27 -34
- package/dist/index.esm443.js.map +1 -1
- package/dist/index.esm444.js +30 -27
- package/dist/index.esm444.js.map +1 -1
- package/dist/index.esm445.js +20 -13
- package/dist/index.esm445.js.map +1 -1
- package/dist/index.esm446.js +3 -16
- package/dist/index.esm446.js.map +1 -1
- package/dist/index.esm447.js +5 -11
- package/dist/index.esm447.js.map +1 -1
- package/dist/index.esm448.js +9 -4
- package/dist/index.esm448.js.map +1 -1
- package/dist/index.esm449.js +6 -3
- package/dist/index.esm449.js.map +1 -1
- package/dist/index.esm45.js +28 -8
- package/dist/index.esm45.js.map +1 -1
- package/dist/index.esm450.js +3 -33
- package/dist/index.esm450.js.map +1 -1
- package/dist/index.esm451.js +85 -26
- package/dist/index.esm451.js.map +1 -1
- package/dist/index.esm452.js +37 -3
- package/dist/index.esm452.js.map +1 -1
- package/dist/index.esm46.js +64 -8
- package/dist/index.esm46.js.map +1 -1
- package/dist/index.esm47.js +11 -47
- package/dist/index.esm48.js +30 -11
- package/dist/index.esm48.js.map +1 -1
- package/dist/index.esm49.js +39 -5
- package/dist/index.esm49.js.map +1 -1
- package/dist/index.esm5.js +2 -2
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.esm50.js +16 -32
- package/dist/index.esm50.js.map +1 -1
- package/dist/index.esm51.js +16 -7
- package/dist/index.esm51.js.map +1 -1
- package/dist/index.esm52.js +5 -9
- package/dist/index.esm52.js.map +1 -1
- package/dist/index.esm53.js +14 -7
- package/dist/index.esm53.js.map +1 -1
- package/dist/index.esm54.js +87 -43
- package/dist/index.esm54.js.map +1 -1
- package/dist/index.esm55.js +32 -8
- package/dist/index.esm55.js.map +1 -1
- package/dist/index.esm56.js +41 -28
- package/dist/index.esm56.js.map +1 -1
- package/dist/index.esm57.js +36 -40
- package/dist/index.esm57.js.map +1 -1
- package/dist/index.esm58.js +6 -10
- package/dist/index.esm58.js.map +1 -1
- package/dist/index.esm59.js +9 -30
- package/dist/index.esm59.js.map +1 -1
- package/dist/index.esm60.js +7 -41
- package/dist/index.esm60.js.map +1 -1
- package/dist/index.esm61.js +8 -39
- package/dist/index.esm61.js.map +1 -1
- package/dist/index.esm62.js +8 -28
- package/dist/index.esm62.js.map +1 -1
- package/dist/index.esm63.js +85 -17
- package/dist/index.esm63.js.map +1 -1
- package/dist/index.esm64.js +35 -16
- package/dist/index.esm64.js.map +1 -1
- package/dist/index.esm65.js +120 -5
- package/dist/index.esm65.js.map +1 -1
- package/dist/index.esm66.js +47 -59
- package/dist/index.esm66.js.map +1 -1
- package/dist/index.esm67.js +11 -85
- package/dist/index.esm67.js.map +1 -1
- package/dist/index.esm68.js +5 -34
- package/dist/index.esm68.js.map +1 -1
- package/dist/index.esm69.js +41 -120
- package/dist/index.esm69.js.map +1 -1
- package/dist/index.esm70.js +8 -40
- package/dist/index.esm70.js.map +1 -1
- package/dist/index.esm71.js +28 -16
- package/dist/index.esm71.js.map +1 -1
- package/dist/index.esm72.js +58 -13
- package/dist/index.esm72.js.map +1 -1
- package/dist/index.esm73.js +16 -87
- package/dist/index.esm73.js.map +1 -1
- package/dist/index.esm86.js +1 -1
- package/dist/index.esm9.js +2 -2
- package/dist/server.cjs.js +1 -1
- package/dist/server.cjs.js.map +1 -1
- package/dist/server.esm.js +2 -2
- package/dist/server.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm62.js
CHANGED
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"wrapper--disabled": "_wrapper--disabled_1xv65_31",
|
|
7
|
-
wrapperDisabled: _,
|
|
8
|
-
input: e,
|
|
9
|
-
iconStart: a,
|
|
10
|
-
iconEnd: w,
|
|
11
|
-
"wrapper--sm": "_wrapper--sm_1xv65_72",
|
|
12
|
-
wrapperSm: t,
|
|
13
|
-
"wrapper--md": "_wrapper--md_1xv65_82",
|
|
14
|
-
wrapperMd: n,
|
|
15
|
-
"wrapper--lg": "_wrapper--lg_1xv65_92",
|
|
16
|
-
wrapperLg: o,
|
|
17
|
-
"wrapper--fullWidth": "_wrapper--fullWidth_1xv65_102",
|
|
18
|
-
wrapperFullWidth: s
|
|
2
|
+
const t = "_quote_10dbe_1", e = "_text_10dbe_9", o = "_author_10dbe_13", _ = {
|
|
3
|
+
quote: t,
|
|
4
|
+
text: e,
|
|
5
|
+
author: o
|
|
19
6
|
};
|
|
20
7
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
e as
|
|
25
|
-
r as wrapper,
|
|
26
|
-
_ as wrapperDisabled,
|
|
27
|
-
p as wrapperError,
|
|
28
|
-
s as wrapperFullWidth,
|
|
29
|
-
o as wrapperLg,
|
|
30
|
-
n as wrapperMd,
|
|
31
|
-
t as wrapperSm
|
|
8
|
+
o as author,
|
|
9
|
+
_ as default,
|
|
10
|
+
t as quote,
|
|
11
|
+
e as text
|
|
32
12
|
};
|
|
33
13
|
//# sourceMappingURL=index.esm62.js.map
|
package/dist/index.esm62.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm62.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm62.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/dist/index.esm63.js
CHANGED
|
@@ -1,21 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
const G = [
|
|
3
|
+
[[0, 0], [1, 0], [0, 1]],
|
|
4
|
+
[[0, 0], [1, 0], [1, 1]],
|
|
5
|
+
[[0, 0], [0, 1], [1, 1]],
|
|
6
|
+
[[0, 1], [1, 0], [1, 1]]
|
|
7
|
+
], B = 9301, w = 49297, m = 233280, F = 4, M = 1, k = 8, X = 0.12, b = 0.3, N = { circle: 0.2, dot: 0.35, triangle: 0.5, diamond: 0.62, cross: 0.75 }, z = 0.3, V = 0.3, Y = 450, j = 320, Z = 300, q = 0.8, v = 0.17, J = 2, K = 5, Q = 0.75;
|
|
8
|
+
function _(t, o, a) {
|
|
9
|
+
return Math.floor(a() * (o - t + 1)) + t;
|
|
10
|
+
}
|
|
11
|
+
function g(t) {
|
|
12
|
+
return () => (t = (t * B + w) % m, t / m);
|
|
13
|
+
}
|
|
14
|
+
function tt(t, o, a, I, i, c = "right", e = 2) {
|
|
15
|
+
return $(t, o, a, I, i, c, e);
|
|
16
|
+
}
|
|
17
|
+
function $(t, o, a, I, i, c, e) {
|
|
18
|
+
if (t <= 0 || o <= 0) return [];
|
|
19
|
+
const u = Math.max(F, a), h = Math.max(M, Math.floor(o / u)), s = Math.min(k, Math.max(M, e));
|
|
20
|
+
let r = 1;
|
|
21
|
+
for (; r < h && o / (r + 1) >= u; )
|
|
22
|
+
r++;
|
|
23
|
+
let n = o / r;
|
|
24
|
+
n > t && (n = t, r = Math.max(M, Math.floor(o / n)));
|
|
25
|
+
const C = t / s, d = o / s;
|
|
26
|
+
if (n = Math.min(n, C, d), n <= 0) return [];
|
|
27
|
+
r = Math.max(M, Math.floor(o / n));
|
|
28
|
+
const p = Math.max(M, Math.floor(t / n)), x = () => i() > X, L = (l) => _(Math.max(M, Math.floor(l * b)), l, i), f = c === "right" || c === "left", y = f ? r : p, T = f ? p : r, A = c === "right" || c === "bottom", S = [];
|
|
29
|
+
for (let l = 0; l < y; l++) {
|
|
30
|
+
if (!x()) continue;
|
|
31
|
+
const R = L(T), O = A ? T - R : 0, P = A ? T : R;
|
|
32
|
+
for (let E = O; E < P; E++) {
|
|
33
|
+
const D = f ? E : l, U = f ? l : E;
|
|
34
|
+
W(S, D * n, U * n, n, n, I, i);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return S;
|
|
38
|
+
}
|
|
39
|
+
function H(t) {
|
|
40
|
+
const o = t();
|
|
41
|
+
if (o < N.circle) return { shapeType: "circle" };
|
|
42
|
+
if (o < N.dot)
|
|
43
|
+
return { shapeType: "dot", dotScale: z + t() * V };
|
|
44
|
+
if (o < N.triangle)
|
|
45
|
+
return {
|
|
46
|
+
shapeType: "triangle",
|
|
47
|
+
triangleIndex: _(0, G.length - 1, t)
|
|
48
|
+
};
|
|
49
|
+
if (o < N.diamond) return { shapeType: "diamond" };
|
|
50
|
+
if (o < N.cross) return { shapeType: "cross" };
|
|
51
|
+
const a = _(J, K, t);
|
|
52
|
+
return {
|
|
53
|
+
shapeType: "stripes",
|
|
54
|
+
stripeDirection: t() > 0.35 ? 1 : 0,
|
|
55
|
+
stripeCount: a,
|
|
56
|
+
stripeMask: Array.from({ length: a }, () => t() > 1 - Q)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function W(t, o, a, I, i, c, e) {
|
|
60
|
+
const u = _(0, c - 1, e);
|
|
61
|
+
let h = _(0, c - 1, e);
|
|
62
|
+
for (; h === u; )
|
|
63
|
+
h = _(0, c - 1, e);
|
|
64
|
+
const s = H(e);
|
|
65
|
+
t.push({
|
|
66
|
+
x: o,
|
|
67
|
+
y: a,
|
|
68
|
+
width: I,
|
|
69
|
+
height: i,
|
|
70
|
+
bgColorIndex: u,
|
|
71
|
+
shapeColorIndex: h,
|
|
72
|
+
shapeType: s.shapeType,
|
|
73
|
+
triangleIndex: s.triangleIndex,
|
|
74
|
+
stripeDirection: s.stripeDirection,
|
|
75
|
+
stripeCount: s.stripeCount,
|
|
76
|
+
stripeMask: s.stripeMask,
|
|
77
|
+
animationDelay: Math.floor(e() * Y),
|
|
78
|
+
animationDuration: j + Math.floor(e() * Z),
|
|
79
|
+
animationScaleFrom: q + e() * v,
|
|
80
|
+
dotScale: s.dotScale
|
|
81
|
+
});
|
|
82
|
+
}
|
|
13
83
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_ as
|
|
18
|
-
n as heartWrap,
|
|
19
|
-
t as likeButton
|
|
84
|
+
G as TRIANGLE_TEMPLATES,
|
|
85
|
+
g as createSeededRandom,
|
|
86
|
+
tt as generatePattern,
|
|
87
|
+
_ as getRandomInt
|
|
20
88
|
};
|
|
21
89
|
//# sourceMappingURL=index.esm63.js.map
|
package/dist/index.esm63.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm63.js","sources":["../src/components/content/DecorativeFrame/utils/patternGenerator.ts"],"sourcesContent":["export type Point2D = [number, number];\n\nexport const TRIANGLE_TEMPLATES: Point2D[][] = [\n [[0, 0], [1, 0], [0, 1]],\n [[0, 0], [1, 0], [1, 1]],\n [[0, 0], [0, 1], [1, 1]],\n [[0, 1], [1, 0], [1, 1]],\n];\n\nexport type ShapeType =\n | 'circle'\n | 'dot'\n | 'triangle'\n | 'diamond'\n | 'cross'\n | 'stripes'\n | null;\n\nexport interface CellConfig {\n x: number;\n y: number;\n width: number;\n height: number;\n bgColorIndex: number;\n shapeColorIndex: number;\n shapeType: ShapeType;\n triangleIndex?: number;\n stripeDirection?: 0 | 1;\n stripeCount?: number;\n stripeMask?: boolean[];\n animationDelay: number;\n animationDuration: number;\n animationScaleFrom?: number;\n dotScale?: number;\n}\n\nconst RNG_MULTIPLIER = 9301;\nconst RNG_INCREMENT = 49297;\nconst RNG_MODULUS = 233280;\n\nconst MIN_BOX_SIZE = 4;\nconst STRIP_LINES_MIN = 1;\nconst STRIP_LINES_MAX = 8;\nconst EMPTY_ROW_CHANCE = 0.12;\nconst FILL_COUNT_MIN_RATIO = 0.3;\n\nconst SHAPE_PROB = { circle: 0.2, dot: 0.35, triangle: 0.5, diamond: 0.62, cross: 0.75 } as const;\nconst DOT_SCALE_MIN = 0.3;\nconst DOT_SCALE_RANGE = 0.3;\nconst ANIM_DELAY_MAX = 450;\nconst ANIM_DURATION_MIN = 320;\nconst ANIM_DURATION_RANGE = 300;\nconst ANIM_SCALE_FROM_MIN = 0.8;\nconst ANIM_SCALE_FROM_RANGE = 0.17;\nconst STRIPE_COUNT_MIN = 2;\nconst STRIPE_COUNT_MAX = 5;\nconst STRIPE_VISIBLE_CHANCE = 0.75;\n\nexport function getRandomInt(min: number, max: number, rng: () => number): number {\n return Math.floor(rng() * (max - min + 1)) + min;\n}\n\nexport function createSeededRandom(seed: number): () => number {\n return () => {\n seed = (seed * RNG_MULTIPLIER + RNG_INCREMENT) % RNG_MODULUS;\n return seed / RNG_MODULUS;\n };\n}\n\nexport type PatternEdge = 'top' | 'right' | 'bottom' | 'left';\n\nexport function generatePattern(\n stripWidth: number,\n stripHeight: number,\n boxSize: number,\n colorCount: number,\n rng: () => number,\n edge: PatternEdge = 'right',\n stripDensity: number = 2\n): CellConfig[] {\n return generateEdgePattern(stripWidth, stripHeight, boxSize, colorCount, rng, edge, stripDensity);\n}\n\nfunction generateEdgePattern(\n stripWidth: number,\n stripHeight: number,\n boxSize: number,\n colorCount: number,\n rng: () => number,\n edge: PatternEdge,\n stripDensity: number\n): CellConfig[] {\n if (stripWidth <= 0 || stripHeight <= 0) return [];\n\n const safeBoxSize = Math.max(MIN_BOX_SIZE, boxSize);\n const maxRows = Math.max(STRIP_LINES_MIN, Math.floor(stripHeight / safeBoxSize));\n const minLines = Math.min(STRIP_LINES_MAX, Math.max(STRIP_LINES_MIN, stripDensity));\n\n let rowCount = 1;\n while (rowCount < maxRows && stripHeight / (rowCount + 1) >= safeBoxSize) {\n rowCount++;\n }\n\n let cellSize = stripHeight / rowCount;\n if (cellSize > stripWidth) {\n cellSize = stripWidth;\n rowCount = Math.max(STRIP_LINES_MIN, Math.floor(stripHeight / cellSize));\n }\n\n const maxCellByWidth = stripWidth / minLines;\n const maxCellByHeight = stripHeight / minLines;\n cellSize = Math.min(cellSize, maxCellByWidth, maxCellByHeight);\n if (cellSize <= 0) return [];\n\n rowCount = Math.max(STRIP_LINES_MIN, Math.floor(stripHeight / cellSize));\n const colCount = Math.max(STRIP_LINES_MIN, Math.floor(stripWidth / cellSize));\n\n const shouldFill = () => rng() > EMPTY_ROW_CHANCE;\n const fillCount = (max: number) =>\n getRandomInt(Math.max(STRIP_LINES_MIN, Math.floor(max * FILL_COUNT_MIN_RATIO)), max, rng);\n\n const isVerticalStrip = edge === 'right' || edge === 'left';\n const primaryCount = isVerticalStrip ? rowCount : colCount;\n const secondaryCount = isVerticalStrip ? colCount : rowCount;\n const isEndEdge = edge === 'right' || edge === 'bottom';\n\n const cells: CellConfig[] = [];\n\n for (let i = 0; i < primaryCount; i++) {\n if (!shouldFill()) continue;\n\n const count = fillCount(secondaryCount);\n const start = isEndEdge ? secondaryCount - count : 0;\n const end = isEndEdge ? secondaryCount : count;\n\n for (let j = start; j < end; j++) {\n const col = isVerticalStrip ? j : i;\n const row = isVerticalStrip ? i : j;\n pushCell(cells, col * cellSize, row * cellSize, cellSize, cellSize, colorCount, rng);\n }\n }\n\n return cells;\n}\n\nfunction pickShapeType(rng: () => number): {\n shapeType: ShapeType;\n triangleIndex?: number;\n stripeDirection?: 0 | 1;\n stripeCount?: number;\n stripeMask?: boolean[];\n dotScale?: number;\n} {\n const roll = rng();\n\n if (roll < SHAPE_PROB.circle) return { shapeType: 'circle' };\n if (roll < SHAPE_PROB.dot) {\n return { shapeType: 'dot', dotScale: DOT_SCALE_MIN + rng() * DOT_SCALE_RANGE };\n }\n if (roll < SHAPE_PROB.triangle) {\n return {\n shapeType: 'triangle',\n triangleIndex: getRandomInt(0, TRIANGLE_TEMPLATES.length - 1, rng),\n };\n }\n if (roll < SHAPE_PROB.diamond) return { shapeType: 'diamond' };\n if (roll < SHAPE_PROB.cross) return { shapeType: 'cross' };\n\n const stripeCount = getRandomInt(STRIPE_COUNT_MIN, STRIPE_COUNT_MAX, rng);\n return {\n shapeType: 'stripes',\n stripeDirection: rng() > 0.35 ? 1 : 0,\n stripeCount,\n stripeMask: Array.from({ length: stripeCount }, () => rng() > 1 - STRIPE_VISIBLE_CHANCE),\n };\n}\n\nfunction pushCell(\n cells: CellConfig[],\n x: number,\n y: number,\n width: number,\n height: number,\n colorCount: number,\n rng: () => number\n): void {\n const bgColorIndex = getRandomInt(0, colorCount - 1, rng);\n let shapeColorIndex = getRandomInt(0, colorCount - 1, rng);\n while (shapeColorIndex === bgColorIndex) {\n shapeColorIndex = getRandomInt(0, colorCount - 1, rng);\n }\n\n const shape = pickShapeType(rng);\n\n cells.push({\n x,\n y,\n width,\n height,\n bgColorIndex,\n shapeColorIndex,\n shapeType: shape.shapeType,\n triangleIndex: shape.triangleIndex,\n stripeDirection: shape.stripeDirection,\n stripeCount: shape.stripeCount,\n stripeMask: shape.stripeMask,\n animationDelay: Math.floor(rng() * ANIM_DELAY_MAX),\n animationDuration: ANIM_DURATION_MIN + Math.floor(rng() * ANIM_DURATION_RANGE),\n animationScaleFrom: ANIM_SCALE_FROM_MIN + rng() * ANIM_SCALE_FROM_RANGE,\n dotScale: shape.dotScale,\n });\n}\n"],"names":["TRIANGLE_TEMPLATES","RNG_MULTIPLIER","RNG_INCREMENT","RNG_MODULUS","MIN_BOX_SIZE","STRIP_LINES_MIN","STRIP_LINES_MAX","EMPTY_ROW_CHANCE","FILL_COUNT_MIN_RATIO","SHAPE_PROB","DOT_SCALE_MIN","DOT_SCALE_RANGE","ANIM_DELAY_MAX","ANIM_DURATION_MIN","ANIM_DURATION_RANGE","ANIM_SCALE_FROM_MIN","ANIM_SCALE_FROM_RANGE","STRIPE_COUNT_MIN","STRIPE_COUNT_MAX","STRIPE_VISIBLE_CHANCE","getRandomInt","min","max","rng","createSeededRandom","seed","generatePattern","stripWidth","stripHeight","boxSize","colorCount","edge","stripDensity","generateEdgePattern","safeBoxSize","maxRows","minLines","rowCount","cellSize","maxCellByWidth","maxCellByHeight","colCount","shouldFill","fillCount","isVerticalStrip","primaryCount","secondaryCount","isEndEdge","cells","i","count","start","end","j","col","row","pushCell","pickShapeType","roll","stripeCount","x","y","width","height","bgColorIndex","shapeColorIndex","shape"],"mappings":";AAEO,MAAMA,IAAkC;AAAA,EAC7C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EACvB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EACvB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EACvB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,GA6BMC,IAAiB,MACjBC,IAAgB,OAChBC,IAAc,QAEdC,IAAe,GACfC,IAAkB,GAClBC,IAAkB,GAClBC,IAAmB,MACnBC,IAAuB,KAEvBC,IAAa,EAAE,QAAQ,KAAK,KAAK,MAAM,UAAU,KAAK,SAAS,MAAM,OAAO,KAAA,GAC5EC,IAAgB,KAChBC,IAAkB,KAClBC,IAAiB,KACjBC,IAAoB,KACpBC,IAAsB,KACtBC,IAAsB,KACtBC,IAAwB,MACxBC,IAAmB,GACnBC,IAAmB,GACnBC,IAAwB;AAEvB,SAASC,EAAaC,GAAaC,GAAaC,GAA2B;AAChF,SAAO,KAAK,MAAMA,EAAA,KAASD,IAAMD,IAAM,EAAE,IAAIA;AAC/C;AAEO,SAASG,EAAmBC,GAA4B;AAC7D,SAAO,OACLA,KAAQA,IAAOxB,IAAiBC,KAAiBC,GAC1C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ACAP,GACM;AACN,QAAMyC,IAAe5C,EAAa,GAAGU,IAAa,GAAGP,CAAG;AACxD,MAAI0C,IAAkB7C,EAAa,GAAGU,IAAa,GAAGP,CAAG;AACzD,SAAO0C,MAAoBD;AACzB,IAAAC,IAAkB7C,EAAa,GAAGU,IAAa,GAAGP,CAAG;AAGvD,QAAM2C,IAAQT,EAAclC,CAAG;AAE/B,EAAAyB,EAAM,KAAK;AAAA,IACT,GAAAY;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAWC,EAAM;AAAA,IACjB,eAAeA,EAAM;AAAA,IACrB,iBAAiBA,EAAM;AAAA,IACvB,aAAaA,EAAM;AAAA,IACnB,YAAYA,EAAM;AAAA,IAClB,gBAAgB,KAAK,MAAM3C,EAAA,IAAQX,CAAc;AAAA,IACjD,mBAAmBC,IAAoB,KAAK,MAAMU,EAAA,IAAQT,CAAmB;AAAA,IAC7E,oBAAoBC,IAAsBQ,EAAA,IAAQP;AAAA,IAClD,UAAUkD,EAAM;AAAA,EAAA,CACjB;AACH;"}
|
package/dist/index.esm64.js
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
const t = "_root_di5ju_1", o = "_root--edge-top_di5ju_7", r = "_root--edge-bottom_di5ju_11", i = "_root--edge-left_di5ju_15", _ = "_root--edge-right_di5ju_19", e = "_content_di5ju_23", s = "_strip_di5ju_29", d = "_strip--top_di5ju_37", p = "_strip--bottom_di5ju_38", g = "_strip--left_di5ju_43", u = "_strip--right_di5ju_44", j = "_stripMirror_di5ju_49", n = {
|
|
3
|
+
root: t,
|
|
4
|
+
"root--edge-top": "_root--edge-top_di5ju_7",
|
|
5
|
+
rootEdgeTop: o,
|
|
6
|
+
"root--edge-bottom": "_root--edge-bottom_di5ju_11",
|
|
7
|
+
rootEdgeBottom: r,
|
|
8
|
+
"root--edge-left": "_root--edge-left_di5ju_15",
|
|
9
|
+
rootEdgeLeft: i,
|
|
10
|
+
"root--edge-right": "_root--edge-right_di5ju_19",
|
|
11
|
+
rootEdgeRight: _,
|
|
12
|
+
content: e,
|
|
13
|
+
strip: s,
|
|
14
|
+
"strip--top": "_strip--top_di5ju_37",
|
|
15
|
+
stripTop: d,
|
|
16
|
+
"strip--bottom": "_strip--bottom_di5ju_38",
|
|
17
|
+
stripBottom: p,
|
|
18
|
+
"strip--left": "_strip--left_di5ju_43",
|
|
19
|
+
stripLeft: g,
|
|
20
|
+
"strip--right": "_strip--right_di5ju_44",
|
|
21
|
+
stripRight: u,
|
|
22
|
+
stripMirror: j
|
|
23
|
+
};
|
|
17
24
|
export {
|
|
18
|
-
|
|
25
|
+
e as content,
|
|
26
|
+
n as default,
|
|
27
|
+
t as root,
|
|
28
|
+
r as rootEdgeBottom,
|
|
29
|
+
i as rootEdgeLeft,
|
|
30
|
+
_ as rootEdgeRight,
|
|
31
|
+
o as rootEdgeTop,
|
|
32
|
+
s as strip,
|
|
33
|
+
p as stripBottom,
|
|
34
|
+
g as stripLeft,
|
|
35
|
+
j as stripMirror,
|
|
36
|
+
u as stripRight,
|
|
37
|
+
d as stripTop
|
|
19
38
|
};
|
|
20
39
|
//# sourceMappingURL=index.esm64.js.map
|
package/dist/index.esm64.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm64.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.esm64.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.esm65.js
CHANGED
|
@@ -1,9 +1,124 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { j as s } from "./index.esm36.js";
|
|
3
|
+
import { TRIANGLE_TEMPLATES as u } from "./index.esm63.js";
|
|
4
|
+
import e from "./index.esm391.js";
|
|
5
|
+
function w(i) {
|
|
6
|
+
return `polygon(${i.map(([c, t]) => `${c * 100}% ${t * 100}%`).join(", ")})`;
|
|
7
|
+
}
|
|
8
|
+
function D({ cell: i, colors: l }) {
|
|
9
|
+
const c = l[i.bgColorIndex] ?? l[0], t = l[i.shapeColorIndex] ?? l[1], o = Math.min(i.width, i.height), {
|
|
10
|
+
x: y,
|
|
11
|
+
y: x,
|
|
12
|
+
width: C,
|
|
13
|
+
height: j,
|
|
14
|
+
shapeType: a,
|
|
15
|
+
triangleIndex: d,
|
|
16
|
+
stripeDirection: h,
|
|
17
|
+
stripeCount: r = 4,
|
|
18
|
+
stripeMask: b,
|
|
19
|
+
animationDelay: v,
|
|
20
|
+
animationDuration: N,
|
|
21
|
+
animationScaleFrom: f = 0.9,
|
|
22
|
+
dotScale: p = 0.45
|
|
23
|
+
} = i, m = h === 1 ? o : o / (r * 2 - 1), g = h === 1 ? o / (r * 2 - 1) : o, $ = b ?? Array(r).fill(!0), k = {
|
|
24
|
+
position: "absolute",
|
|
25
|
+
left: y,
|
|
26
|
+
top: x,
|
|
27
|
+
width: C,
|
|
28
|
+
height: j,
|
|
29
|
+
"--cell-delay": `${v}ms`,
|
|
30
|
+
"--cell-duration": `${N}ms`,
|
|
31
|
+
"--cell-scale-from": f
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ s.jsxs(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: e.cell,
|
|
37
|
+
style: k,
|
|
38
|
+
"aria-hidden": !0,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ s.jsx("div", { className: e.bg, style: { backgroundColor: c } }),
|
|
41
|
+
a === "circle" && /* @__PURE__ */ s.jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: e.shapeCircle,
|
|
45
|
+
style: { backgroundColor: t }
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
a === "dot" && /* @__PURE__ */ s.jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: e.shapeDot,
|
|
52
|
+
style: {
|
|
53
|
+
backgroundColor: t,
|
|
54
|
+
width: `${p * 100}%`,
|
|
55
|
+
height: `${p * 100}%`
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
a === "triangle" && d !== void 0 && u[d] && /* @__PURE__ */ s.jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: e.shapeTriangle,
|
|
63
|
+
style: {
|
|
64
|
+
backgroundColor: t,
|
|
65
|
+
clipPath: w(u[d])
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
a === "diamond" && /* @__PURE__ */ s.jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: e.shapeDiamond,
|
|
73
|
+
style: { backgroundColor: t }
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
a === "cross" && /* @__PURE__ */ s.jsxs("div", { className: e.shapeCross, children: [
|
|
77
|
+
/* @__PURE__ */ s.jsx(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: e.crossBar,
|
|
81
|
+
style: { backgroundColor: t }
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ s.jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: e.crossBarVertical,
|
|
88
|
+
style: { backgroundColor: t }
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] }),
|
|
92
|
+
a === "stripes" && /* @__PURE__ */ s.jsx("div", { className: e.stripes, children: Array.from(
|
|
93
|
+
{ length: r },
|
|
94
|
+
(P, n) => $[n] ? /* @__PURE__ */ s.jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: e.stripe,
|
|
98
|
+
style: {
|
|
99
|
+
backgroundColor: t,
|
|
100
|
+
...h === 1 ? {
|
|
101
|
+
top: `${2 * n * g / o * 100}%`,
|
|
102
|
+
left: 0,
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: `${g / o * 100}%`
|
|
105
|
+
} : {
|
|
106
|
+
left: `${2 * n * m / o * 100}%`,
|
|
107
|
+
top: 0,
|
|
108
|
+
width: `${m / o * 100}%`,
|
|
109
|
+
height: "100%"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
n
|
|
114
|
+
) : null
|
|
115
|
+
) })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
D.displayName = "PatternCell";
|
|
5
121
|
export {
|
|
6
|
-
|
|
7
|
-
s as grid
|
|
122
|
+
D as PatternCell
|
|
8
123
|
};
|
|
9
124
|
//# sourceMappingURL=index.esm65.js.map
|
package/dist/index.esm65.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm65.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm65.js","sources":["../src/components/content/DecorativeFrame/components/PatternCell/PatternCell.tsx"],"sourcesContent":["import React from 'react';\nimport type { CellConfig, Point2D } from '../../utils/patternGenerator';\nimport { TRIANGLE_TEMPLATES } from '../../utils/patternGenerator';\nimport styles from './PatternCell.module.pcss';\n\nexport interface PatternCellProps {\n cell: CellConfig;\n colors: string[];\n}\n\nfunction polygonClipPath(template: Point2D[]): string {\n const points = template.map(([px, py]) => `${px * 100}% ${py * 100}%`).join(', ');\n return `polygon(${points})`;\n}\n\nexport function PatternCell({ cell, colors }: PatternCellProps) {\n const bgColor = colors[cell.bgColorIndex] ?? colors[0];\n const shapeColor = colors[cell.shapeColorIndex] ?? colors[1];\n const size = Math.min(cell.width, cell.height);\n const {\n x,\n y,\n width: cellWidth,\n height: cellHeight,\n shapeType,\n triangleIndex,\n stripeDirection,\n stripeCount = 4,\n stripeMask,\n animationDelay,\n animationDuration,\n animationScaleFrom = 0.9,\n dotScale = 0.45,\n } = cell;\n\n const stripeWidth =\n stripeDirection === 1 ? size : size / (stripeCount * 2 - 1);\n const stripeHeight =\n stripeDirection === 1 ? size / (stripeCount * 2 - 1) : size;\n const visibleStripes = stripeMask ?? Array(stripeCount).fill(true);\n\n const cellStyle: React.CSSProperties = {\n position: 'absolute',\n left: x,\n top: y,\n width: cellWidth,\n height: cellHeight,\n '--cell-delay': `${animationDelay}ms`,\n '--cell-duration': `${animationDuration}ms`,\n '--cell-scale-from': animationScaleFrom,\n } as React.CSSProperties;\n\n return (\n <div\n className={styles.cell}\n style={cellStyle}\n aria-hidden\n >\n <div className={styles.bg} style={{ backgroundColor: bgColor }} />\n\n {shapeType === 'circle' && (\n <div\n className={styles.shapeCircle}\n style={{ backgroundColor: shapeColor }}\n />\n )}\n\n {shapeType === 'dot' && (\n <div\n className={styles.shapeDot}\n style={{\n backgroundColor: shapeColor,\n width: `${dotScale * 100}%`,\n height: `${dotScale * 100}%`,\n }}\n />\n )}\n\n {shapeType === 'triangle' &&\n triangleIndex !== undefined &&\n TRIANGLE_TEMPLATES[triangleIndex] && (\n <div\n className={styles.shapeTriangle}\n style={{\n backgroundColor: shapeColor,\n clipPath: polygonClipPath(TRIANGLE_TEMPLATES[triangleIndex]!),\n }}\n />\n )}\n\n {shapeType === 'diamond' && (\n <div\n className={styles.shapeDiamond}\n style={{ backgroundColor: shapeColor }}\n />\n )}\n\n {shapeType === 'cross' && (\n <div className={styles.shapeCross}>\n <div\n className={styles.crossBar}\n style={{ backgroundColor: shapeColor }}\n />\n <div\n className={styles.crossBarVertical}\n style={{ backgroundColor: shapeColor }}\n />\n </div>\n )}\n\n {shapeType === 'stripes' && (\n <div className={styles.stripes}>\n {Array.from({ length: stripeCount }, (_, i) =>\n visibleStripes[i] ? (\n <div\n key={i}\n className={styles.stripe}\n style={{\n backgroundColor: shapeColor,\n ...(stripeDirection === 1\n ? {\n top: `${((2 * i * stripeHeight) / size) * 100}%`,\n left: 0,\n width: '100%',\n height: `${(stripeHeight / size) * 100}%`,\n }\n : {\n left: `${((2 * i * stripeWidth) / size) * 100}%`,\n top: 0,\n width: `${(stripeWidth / size) * 100}%`,\n height: '100%',\n }),\n }}\n />\n ) : null\n )}\n </div>\n )}\n </div>\n );\n}\n\nPatternCell.displayName = 'PatternCell';\n"],"names":["polygonClipPath","template","px","py","PatternCell","cell","colors","bgColor","shapeColor","size","x","y","cellWidth","cellHeight","shapeType","triangleIndex","stripeDirection","stripeCount","stripeMask","animationDelay","animationDuration","animationScaleFrom","dotScale","stripeWidth","stripeHeight","visibleStripes","cellStyle","jsxs","styles","jsx","TRIANGLE_TEMPLATES","_","i"],"mappings":";;;;AAUA,SAASA,EAAgBC,GAA6B;AAEpD,SAAO,WADQA,EAAS,IAAI,CAAC,CAACC,GAAIC,CAAE,MAAM,GAAGD,IAAK,GAAG,KAAKC,IAAK,GAAG,GAAG,EAAE,KAAK,IAAI,CACxD;AAC1B;AAEO,SAASC,EAAY,EAAE,MAAAC,GAAM,QAAAC,KAA4B;AAC9D,QAAMC,IAAUD,EAAOD,EAAK,YAAY,KAAKC,EAAO,CAAC,GAC/CE,IAAaF,EAAOD,EAAK,eAAe,KAAKC,EAAO,CAAC,GACrDG,IAAO,KAAK,IAAIJ,EAAK,OAAOA,EAAK,MAAM,GACvC;AAAA,IACJ,GAAAK;AAAA,IACA,GAAAC;AAAA,IACA,OAAOC;AAAA,IACP,QAAQC;AAAA,IACR,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC,IAAqB;AAAA,IACrB,UAAAC,IAAW;AAAA,EAAA,IACTjB,GAEEkB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UAAA,IAmBL;AAAA,QAAA,EACN,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;AAEA5B,EAAY,cAAc;"}
|
package/dist/index.esm66.js
CHANGED
|
@@ -1,63 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"stack--direction-row-reverse": "_stack--direction-row-reverse_45gcn_14",
|
|
9
|
-
stackDirectionRowReverse: a,
|
|
10
|
-
"stack--direction-column-reverse": "_stack--direction-column-reverse_45gcn_18",
|
|
11
|
-
stackDirectionColumnReverse: n,
|
|
12
|
-
"stack--align-start": "_stack--align-start_45gcn_23",
|
|
13
|
-
stackAlignStart: e,
|
|
14
|
-
"stack--align-end": "_stack--align-end_45gcn_27",
|
|
15
|
-
stackAlignEnd: r,
|
|
16
|
-
"stack--align-center": "_stack--align-center_45gcn_31",
|
|
17
|
-
stackAlignCenter: _,
|
|
18
|
-
"stack--align-stretch": "_stack--align-stretch_45gcn_35",
|
|
19
|
-
stackAlignStretch: i,
|
|
20
|
-
"stack--align-baseline": "_stack--align-baseline_45gcn_39",
|
|
21
|
-
stackAlignBaseline: k,
|
|
22
|
-
"stack--justify-start": "_stack--justify-start_45gcn_44",
|
|
23
|
-
stackJustifyStart: o,
|
|
24
|
-
"stack--justify-end": "_stack--justify-end_45gcn_48",
|
|
25
|
-
stackJustifyEnd: g,
|
|
26
|
-
"stack--justify-center": "_stack--justify-center_45gcn_52",
|
|
27
|
-
stackJustifyCenter: l,
|
|
28
|
-
"stack--justify-between": "_stack--justify-between_45gcn_56",
|
|
29
|
-
stackJustifyBetween: u,
|
|
30
|
-
"stack--justify-around": "_stack--justify-around_45gcn_60",
|
|
31
|
-
stackJustifyAround: y,
|
|
32
|
-
"stack--justify-evenly": "_stack--justify-evenly_45gcn_64",
|
|
33
|
-
stackJustifyEvenly: w,
|
|
34
|
-
"stack--wrap-nowrap": "_stack--wrap-nowrap_45gcn_69",
|
|
35
|
-
stackWrapNowrap: f,
|
|
36
|
-
"stack--wrap-wrap": "_stack--wrap-wrap_45gcn_73",
|
|
37
|
-
stackWrapWrap: p,
|
|
38
|
-
"stack--wrap-wrap-reverse": "_stack--wrap-wrap-reverse_45gcn_77",
|
|
39
|
-
stackWrapWrapReverse: d
|
|
40
|
-
};
|
|
2
|
+
import { codeToHtml as n, createHighlighter as a } from "./index.esm79.js";
|
|
3
|
+
import { createOnigurumaEngine as o, loadWasm as i } from "./index.esm80.js";
|
|
4
|
+
import { addClassToHast as s, applyColorReplacements as g, createBundledHighlighter as m, createHighlighterCore as d, createPositionConverter as h, createShikiInternal as c, createShikiInternalSync as p, createSingletonShorthands as u, flatTokenVariants as T, getTokenStyleObject as k, guessEmbeddedLanguages as f, hastToHtml as S, isNoneTheme as b, isPlainLang as H, isSpecialLang as L, isSpecialTheme as x, makeSingletonHighlighter as y, normalizeGetter as C, normalizeTheme as z, resolveColorReplacements as I, splitLines as A, splitToken as E, splitTokens as W, stringifyTokenStyle as v, toArray as B, tokenizeAnsiWithTheme as D, tokenizeWithTheme as O, tokensToHast as P, transformerDecorations as R, warnDeprecated as j } from "./index.esm81.js";
|
|
5
|
+
import { bundledLanguages as G, bundledLanguagesAlias as N, bundledLanguagesBase as V, bundledLanguagesInfo as q } from "./index.esm82.js";
|
|
6
|
+
import { bundledThemes as J, bundledThemesInfo as K } from "./index.esm83.js";
|
|
7
|
+
import { ShikiError as Q } from "./index.esm84.js";
|
|
41
8
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
9
|
+
Q as ShikiError,
|
|
10
|
+
s as addClassToHast,
|
|
11
|
+
g as applyColorReplacements,
|
|
12
|
+
G as bundledLanguages,
|
|
13
|
+
N as bundledLanguagesAlias,
|
|
14
|
+
V as bundledLanguagesBase,
|
|
15
|
+
q as bundledLanguagesInfo,
|
|
16
|
+
J as bundledThemes,
|
|
17
|
+
K as bundledThemesInfo,
|
|
18
|
+
n as codeToHtml,
|
|
19
|
+
m as createBundledHighlighter,
|
|
20
|
+
a as createHighlighter,
|
|
21
|
+
d as createHighlighterCore,
|
|
22
|
+
o as createOnigurumaEngine,
|
|
23
|
+
h as createPositionConverter,
|
|
24
|
+
c as createShikiInternal,
|
|
25
|
+
p as createShikiInternalSync,
|
|
26
|
+
u as createSingletonShorthands,
|
|
27
|
+
T as flatTokenVariants,
|
|
28
|
+
k as getTokenStyleObject,
|
|
29
|
+
f as guessEmbeddedLanguages,
|
|
30
|
+
S as hastToHtml,
|
|
31
|
+
b as isNoneTheme,
|
|
32
|
+
H as isPlainLang,
|
|
33
|
+
L as isSpecialLang,
|
|
34
|
+
x as isSpecialTheme,
|
|
35
|
+
i as loadWasm,
|
|
36
|
+
y as makeSingletonHighlighter,
|
|
37
|
+
C as normalizeGetter,
|
|
38
|
+
z as normalizeTheme,
|
|
39
|
+
I as resolveColorReplacements,
|
|
40
|
+
A as splitLines,
|
|
41
|
+
E as splitToken,
|
|
42
|
+
W as splitTokens,
|
|
43
|
+
v as stringifyTokenStyle,
|
|
44
|
+
B as toArray,
|
|
45
|
+
D as tokenizeAnsiWithTheme,
|
|
46
|
+
O as tokenizeWithTheme,
|
|
47
|
+
P as tokensToHast,
|
|
48
|
+
R as transformerDecorations,
|
|
49
|
+
j as warnDeprecated
|
|
62
50
|
};
|
|
63
51
|
//# sourceMappingURL=index.esm66.js.map
|
package/dist/index.esm66.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm66.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm66.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/index.esm67.js
CHANGED
|
@@ -1,89 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function _(t, o, a) {
|
|
9
|
-
return Math.floor(a() * (o - t + 1)) + t;
|
|
10
|
-
}
|
|
11
|
-
function g(t) {
|
|
12
|
-
return () => (t = (t * B + w) % m, t / m);
|
|
13
|
-
}
|
|
14
|
-
function tt(t, o, a, I, i, c = "right", e = 2) {
|
|
15
|
-
return $(t, o, a, I, i, c, e);
|
|
16
|
-
}
|
|
17
|
-
function $(t, o, a, I, i, c, e) {
|
|
18
|
-
if (t <= 0 || o <= 0) return [];
|
|
19
|
-
const u = Math.max(F, a), h = Math.max(M, Math.floor(o / u)), s = Math.min(k, Math.max(M, e));
|
|
20
|
-
let r = 1;
|
|
21
|
-
for (; r < h && o / (r + 1) >= u; )
|
|
22
|
-
r++;
|
|
23
|
-
let n = o / r;
|
|
24
|
-
n > t && (n = t, r = Math.max(M, Math.floor(o / n)));
|
|
25
|
-
const C = t / s, d = o / s;
|
|
26
|
-
if (n = Math.min(n, C, d), n <= 0) return [];
|
|
27
|
-
r = Math.max(M, Math.floor(o / n));
|
|
28
|
-
const p = Math.max(M, Math.floor(t / n)), x = () => i() > X, L = (l) => _(Math.max(M, Math.floor(l * b)), l, i), f = c === "right" || c === "left", y = f ? r : p, T = f ? p : r, A = c === "right" || c === "bottom", S = [];
|
|
29
|
-
for (let l = 0; l < y; l++) {
|
|
30
|
-
if (!x()) continue;
|
|
31
|
-
const R = L(T), O = A ? T - R : 0, P = A ? T : R;
|
|
32
|
-
for (let E = O; E < P; E++) {
|
|
33
|
-
const D = f ? E : l, U = f ? l : E;
|
|
34
|
-
W(S, D * n, U * n, n, n, I, i);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return S;
|
|
38
|
-
}
|
|
39
|
-
function H(t) {
|
|
40
|
-
const o = t();
|
|
41
|
-
if (o < N.circle) return { shapeType: "circle" };
|
|
42
|
-
if (o < N.dot)
|
|
43
|
-
return { shapeType: "dot", dotScale: z + t() * V };
|
|
44
|
-
if (o < N.triangle)
|
|
45
|
-
return {
|
|
46
|
-
shapeType: "triangle",
|
|
47
|
-
triangleIndex: _(0, G.length - 1, t)
|
|
48
|
-
};
|
|
49
|
-
if (o < N.diamond) return { shapeType: "diamond" };
|
|
50
|
-
if (o < N.cross) return { shapeType: "cross" };
|
|
51
|
-
const a = _(J, K, t);
|
|
52
|
-
return {
|
|
53
|
-
shapeType: "stripes",
|
|
54
|
-
stripeDirection: t() > 0.35 ? 1 : 0,
|
|
55
|
-
stripeCount: a,
|
|
56
|
-
stripeMask: Array.from({ length: a }, () => t() > 1 - Q)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function W(t, o, a, I, i, c, e) {
|
|
60
|
-
const u = _(0, c - 1, e);
|
|
61
|
-
let h = _(0, c - 1, e);
|
|
62
|
-
for (; h === u; )
|
|
63
|
-
h = _(0, c - 1, e);
|
|
64
|
-
const s = H(e);
|
|
65
|
-
t.push({
|
|
66
|
-
x: o,
|
|
67
|
-
y: a,
|
|
68
|
-
width: I,
|
|
69
|
-
height: i,
|
|
70
|
-
bgColorIndex: u,
|
|
71
|
-
shapeColorIndex: h,
|
|
72
|
-
shapeType: s.shapeType,
|
|
73
|
-
triangleIndex: s.triangleIndex,
|
|
74
|
-
stripeDirection: s.stripeDirection,
|
|
75
|
-
stripeCount: s.stripeCount,
|
|
76
|
-
stripeMask: s.stripeMask,
|
|
77
|
-
animationDelay: Math.floor(e() * Y),
|
|
78
|
-
animationDuration: j + Math.floor(e() * Z),
|
|
79
|
-
animationScaleFrom: q + e() * v,
|
|
80
|
-
dotScale: s.dotScale
|
|
81
|
-
});
|
|
82
|
-
}
|
|
2
|
+
const e = "_root_yhe7w_1", o = "_filename_yhe7w_8", r = "_code_yhe7w_15", t = "_error_yhe7w_50", _ = {
|
|
3
|
+
root: e,
|
|
4
|
+
filename: o,
|
|
5
|
+
code: r,
|
|
6
|
+
error: t
|
|
7
|
+
};
|
|
83
8
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
9
|
+
r as code,
|
|
10
|
+
_ as default,
|
|
11
|
+
t as error,
|
|
12
|
+
o as filename,
|
|
13
|
+
e as root
|
|
88
14
|
};
|
|
89
15
|
//# sourceMappingURL=index.esm67.js.map
|
package/dist/index.esm67.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm67.js","sources":["../src/components/content/DecorativeFrame/utils/patternGenerator.ts"],"sourcesContent":["export type Point2D = [number, number];\n\nexport const TRIANGLE_TEMPLATES: Point2D[][] = [\n [[0, 0], [1, 0], [0, 1]],\n [[0, 0], [1, 0], [1, 1]],\n [[0, 0], [0, 1], [1, 1]],\n [[0, 1], [1, 0], [1, 1]],\n];\n\nexport type ShapeType =\n | 'circle'\n | 'dot'\n | 'triangle'\n | 'diamond'\n | 'cross'\n | 'stripes'\n | null;\n\nexport interface CellConfig {\n x: number;\n y: number;\n width: number;\n height: number;\n bgColorIndex: number;\n shapeColorIndex: number;\n shapeType: ShapeType;\n triangleIndex?: number;\n stripeDirection?: 0 | 1;\n stripeCount?: number;\n stripeMask?: boolean[];\n animationDelay: number;\n animationDuration: number;\n animationScaleFrom?: number;\n dotScale?: number;\n}\n\nconst RNG_MULTIPLIER = 9301;\nconst RNG_INCREMENT = 49297;\nconst RNG_MODULUS = 233280;\n\nconst MIN_BOX_SIZE = 4;\nconst STRIP_LINES_MIN = 1;\nconst STRIP_LINES_MAX = 8;\nconst EMPTY_ROW_CHANCE = 0.12;\nconst FILL_COUNT_MIN_RATIO = 0.3;\n\nconst SHAPE_PROB = { circle: 0.2, dot: 0.35, triangle: 0.5, diamond: 0.62, cross: 0.75 } as const;\nconst DOT_SCALE_MIN = 0.3;\nconst DOT_SCALE_RANGE = 0.3;\nconst ANIM_DELAY_MAX = 450;\nconst ANIM_DURATION_MIN = 320;\nconst ANIM_DURATION_RANGE = 300;\nconst ANIM_SCALE_FROM_MIN = 0.8;\nconst ANIM_SCALE_FROM_RANGE = 0.17;\nconst STRIPE_COUNT_MIN = 2;\nconst STRIPE_COUNT_MAX = 5;\nconst STRIPE_VISIBLE_CHANCE = 0.75;\n\nexport function getRandomInt(min: number, max: number, rng: () => number): number {\n return Math.floor(rng() * (max - min + 1)) + min;\n}\n\nexport function createSeededRandom(seed: number): () => number {\n return () => {\n seed = (seed * RNG_MULTIPLIER + RNG_INCREMENT) % RNG_MODULUS;\n return seed / RNG_MODULUS;\n };\n}\n\nexport type PatternEdge = 'top' | 'right' | 'bottom' | 'left';\n\nexport function generatePattern(\n stripWidth: number,\n stripHeight: number,\n boxSize: number,\n colorCount: number,\n rng: () => number,\n edge: PatternEdge = 'right',\n stripDensity: number = 2\n): CellConfig[] {\n return generateEdgePattern(stripWidth, stripHeight, boxSize, colorCount, rng, edge, stripDensity);\n}\n\nfunction generateEdgePattern(\n stripWidth: number,\n stripHeight: number,\n boxSize: number,\n colorCount: number,\n rng: () => number,\n edge: PatternEdge,\n stripDensity: number\n): CellConfig[] {\n if (stripWidth <= 0 || stripHeight <= 0) return [];\n\n const safeBoxSize = Math.max(MIN_BOX_SIZE, boxSize);\n const maxRows = Math.max(STRIP_LINES_MIN, Math.floor(stripHeight / safeBoxSize));\n const minLines = Math.min(STRIP_LINES_MAX, Math.max(STRIP_LINES_MIN, stripDensity));\n\n let rowCount = 1;\n while (rowCount < maxRows && stripHeight / (rowCount + 1) >= safeBoxSize) {\n rowCount++;\n }\n\n let cellSize = stripHeight / rowCount;\n if (cellSize > stripWidth) {\n cellSize = stripWidth;\n rowCount = Math.max(STRIP_LINES_MIN, Math.floor(stripHeight / cellSize));\n }\n\n const maxCellByWidth = stripWidth / minLines;\n const maxCellByHeight = stripHeight / minLines;\n cellSize = Math.min(cellSize, maxCellByWidth, maxCellByHeight);\n if (cellSize <= 0) return [];\n\n rowCount = Math.max(STRIP_LINES_MIN, Math.floor(stripHeight / cellSize));\n const colCount = Math.max(STRIP_LINES_MIN, Math.floor(stripWidth / cellSize));\n\n const shouldFill = () => rng() > EMPTY_ROW_CHANCE;\n const fillCount = (max: number) =>\n getRandomInt(Math.max(STRIP_LINES_MIN, Math.floor(max * FILL_COUNT_MIN_RATIO)), max, rng);\n\n const isVerticalStrip = edge === 'right' || edge === 'left';\n const primaryCount = isVerticalStrip ? rowCount : colCount;\n const secondaryCount = isVerticalStrip ? colCount : rowCount;\n const isEndEdge = edge === 'right' || edge === 'bottom';\n\n const cells: CellConfig[] = [];\n\n for (let i = 0; i < primaryCount; i++) {\n if (!shouldFill()) continue;\n\n const count = fillCount(secondaryCount);\n const start = isEndEdge ? secondaryCount - count : 0;\n const end = isEndEdge ? secondaryCount : count;\n\n for (let j = start; j < end; j++) {\n const col = isVerticalStrip ? j : i;\n const row = isVerticalStrip ? i : j;\n pushCell(cells, col * cellSize, row * cellSize, cellSize, cellSize, colorCount, rng);\n }\n }\n\n return cells;\n}\n\nfunction pickShapeType(rng: () => number): {\n shapeType: ShapeType;\n triangleIndex?: number;\n stripeDirection?: 0 | 1;\n stripeCount?: number;\n stripeMask?: boolean[];\n dotScale?: number;\n} {\n const roll = rng();\n\n if (roll < SHAPE_PROB.circle) return { shapeType: 'circle' };\n if (roll < SHAPE_PROB.dot) {\n return { shapeType: 'dot', dotScale: DOT_SCALE_MIN + rng() * DOT_SCALE_RANGE };\n }\n if (roll < SHAPE_PROB.triangle) {\n return {\n shapeType: 'triangle',\n triangleIndex: getRandomInt(0, TRIANGLE_TEMPLATES.length - 1, rng),\n };\n }\n if (roll < SHAPE_PROB.diamond) return { shapeType: 'diamond' };\n if (roll < SHAPE_PROB.cross) return { shapeType: 'cross' };\n\n const stripeCount = getRandomInt(STRIPE_COUNT_MIN, STRIPE_COUNT_MAX, rng);\n return {\n shapeType: 'stripes',\n stripeDirection: rng() > 0.35 ? 1 : 0,\n stripeCount,\n stripeMask: Array.from({ length: stripeCount }, () => rng() > 1 - STRIPE_VISIBLE_CHANCE),\n };\n}\n\nfunction pushCell(\n cells: CellConfig[],\n x: number,\n y: number,\n width: number,\n height: number,\n colorCount: number,\n rng: () => number\n): void {\n const bgColorIndex = getRandomInt(0, colorCount - 1, rng);\n let shapeColorIndex = getRandomInt(0, colorCount - 1, rng);\n while (shapeColorIndex === bgColorIndex) {\n shapeColorIndex = getRandomInt(0, colorCount - 1, rng);\n }\n\n const shape = pickShapeType(rng);\n\n cells.push({\n x,\n y,\n width,\n height,\n bgColorIndex,\n shapeColorIndex,\n shapeType: shape.shapeType,\n triangleIndex: shape.triangleIndex,\n stripeDirection: shape.stripeDirection,\n stripeCount: shape.stripeCount,\n stripeMask: shape.stripeMask,\n animationDelay: Math.floor(rng() * ANIM_DELAY_MAX),\n animationDuration: ANIM_DURATION_MIN + Math.floor(rng() * ANIM_DURATION_RANGE),\n animationScaleFrom: ANIM_SCALE_FROM_MIN + rng() * ANIM_SCALE_FROM_RANGE,\n dotScale: shape.dotScale,\n });\n}\n"],"names":["TRIANGLE_TEMPLATES","RNG_MULTIPLIER","RNG_INCREMENT","RNG_MODULUS","MIN_BOX_SIZE","STRIP_LINES_MIN","STRIP_LINES_MAX","EMPTY_ROW_CHANCE","FILL_COUNT_MIN_RATIO","SHAPE_PROB","DOT_SCALE_MIN","DOT_SCALE_RANGE","ANIM_DELAY_MAX","ANIM_DURATION_MIN","ANIM_DURATION_RANGE","ANIM_SCALE_FROM_MIN","ANIM_SCALE_FROM_RANGE","STRIPE_COUNT_MIN","STRIPE_COUNT_MAX","STRIPE_VISIBLE_CHANCE","getRandomInt","min","max","rng","createSeededRandom","seed","generatePattern","stripWidth","stripHeight","boxSize","colorCount","edge","stripDensity","generateEdgePattern","safeBoxSize","maxRows","minLines","rowCount","cellSize","maxCellByWidth","maxCellByHeight","colCount","shouldFill","fillCount","isVerticalStrip","primaryCount","secondaryCount","isEndEdge","cells","i","count","start","end","j","col","row","pushCell","pickShapeType","roll","stripeCount","x","y","width","height","bgColorIndex","shapeColorIndex","shape"],"mappings":";AAEO,MAAMA,IAAkC;AAAA,EAC7C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EACvB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EACvB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EACvB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,GA6BMC,IAAiB,MACjBC,IAAgB,OAChBC,IAAc,QAEdC,IAAe,GACfC,IAAkB,GAClBC,IAAkB,GAClBC,IAAmB,MACnBC,IAAuB,KAEvBC,IAAa,EAAE,QAAQ,KAAK,KAAK,MAAM,UAAU,KAAK,SAAS,MAAM,OAAO,KAAA,GAC5EC,IAAgB,KAChBC,IAAkB,KAClBC,IAAiB,KACjBC,IAAoB,KACpBC,IAAsB,KACtBC,IAAsB,KACtBC,IAAwB,MACxBC,IAAmB,GACnBC,IAAmB,GACnBC,IAAwB;AAEvB,SAASC,EAAaC,GAAaC,GAAaC,GAA2B;AAChF,SAAO,KAAK,MAAMA,EAAA,KAASD,IAAMD,IAAM,EAAE,IAAIA;AAC/C;AAEO,SAASG,EAAmBC,GAA4B;AAC7D,SAAO,OACLA,KAAQA,IAAOxB,IAAiBC,KAAiBC,GAC1CsB,IAAOtB;AAElB;AAIO,SAASuB,GACdC,GACAC,GACAC,GACAC,GACAP,GACAQ,IAAoB,SACpBC,IAAuB,GACT;AACd,SAAOC,EAAoBN,GAAYC,GAAaC,GAASC,GAAYP,GAAKQ,GAAMC,CAAY;AAClG;AAEA,SAASC,EACPN,GACAC,GACA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