@actioneer/ads 0.5.8 → 0.6.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/components/assistant-ui/composer-harness.js +12 -10
- package/components/avatar.d.ts +1 -0
- package/components/avatar.js +5 -4
- package/components/breadcrumbs.d.ts +3 -1
- package/components/breadcrumbs.js +62 -56
- package/components/button.js +11 -11
- package/components/card.js +19 -18
- package/components/chart.d.ts +6 -0
- package/components/chart.js +747 -657
- package/components/date-range-picker.d.ts +25 -0
- package/components/date-range-picker.js +187 -0
- package/components/drawer.d.ts +3 -1
- package/components/drawer.js +115 -95
- package/components/index.d.ts +1 -0
- package/components/index.js +499 -497
- package/components/modal.d.ts +5 -1
- package/components/modal.js +74 -61
- package/components/panel.js +31 -28
- package/components/pixel-icon.d.ts +4 -0
- package/components/pixel-icon.js +210 -163
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +31 -28
- package/components/select.d.ts +5 -0
- package/components/select.js +177 -132
- package/components/table.d.ts +7 -0
- package/components/table.js +183 -173
- package/components/tabs.js +1 -1
- package/components/tree.js +86 -58
- package/components/viz-charts.js +186 -183
- package/demo/components/add-to-artifact.js +131 -107
- package/demo/lib/artifact-library.js +37 -29
- package/demo/lib/artifact-pin-guard.js +12 -0
- package/fonts.css +2 -0
- package/lib/icons.d.ts +20 -0
- package/lib/icons.js +112 -107
- package/llms.txt +23 -3
- package/manifest.json +13774 -14
- package/package.json +4 -1
- package/styles.css +76 -60
- package/theme.css +70 -57
package/components/pixel-icon.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var i = (
|
|
5
|
-
import { jsx as
|
|
6
|
-
import * as
|
|
7
|
-
import { Renderer as
|
|
8
|
-
import { cn as
|
|
9
|
-
const
|
|
2
|
+
var I = Object.defineProperty;
|
|
3
|
+
var O = (o, e, t) => e in o ? I(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
4
|
+
var i = (o, e, t) => O(o, typeof e != "symbol" ? e + "" : e, t);
|
|
5
|
+
import { jsx as z } from "react/jsx-runtime";
|
|
6
|
+
import * as D from "react";
|
|
7
|
+
import { Renderer as K, Triangle as U, Program as _, Mesh as N, Texture as q } from "ogl";
|
|
8
|
+
import { cn as V } from "../lib/cn.js";
|
|
9
|
+
const P = {
|
|
10
10
|
growth: [
|
|
11
11
|
"...##....##....##",
|
|
12
12
|
"..###...###...###",
|
|
@@ -94,7 +94,7 @@ const R = {
|
|
|
94
94
|
"...............",
|
|
95
95
|
"..............."
|
|
96
96
|
]
|
|
97
|
-
},
|
|
97
|
+
}, M = [
|
|
98
98
|
"var(--color-ink-950)",
|
|
99
99
|
"var(--color-ink-950)",
|
|
100
100
|
"var(--color-ink-900)",
|
|
@@ -105,7 +105,7 @@ const R = {
|
|
|
105
105
|
"var(--color-ink-800)",
|
|
106
106
|
"var(--color-ink-700)",
|
|
107
107
|
"var(--color-ink-700)"
|
|
108
|
-
],
|
|
108
|
+
], X = [
|
|
109
109
|
"var(--color-warning-700)",
|
|
110
110
|
"var(--color-warning-700)",
|
|
111
111
|
"var(--color-warning-600)",
|
|
@@ -116,13 +116,20 @@ const R = {
|
|
|
116
116
|
"var(--color-chart-2)",
|
|
117
117
|
"var(--color-amber-soft)",
|
|
118
118
|
"var(--color-amber-soft)"
|
|
119
|
-
],
|
|
120
|
-
growth:
|
|
121
|
-
"document-agent":
|
|
122
|
-
search:
|
|
123
|
-
books:
|
|
124
|
-
artifacts:
|
|
125
|
-
}
|
|
119
|
+
], R = {
|
|
120
|
+
growth: M,
|
|
121
|
+
"document-agent": M,
|
|
122
|
+
search: M,
|
|
123
|
+
books: M,
|
|
124
|
+
artifacts: X
|
|
125
|
+
};
|
|
126
|
+
function F(o) {
|
|
127
|
+
return o.length === 0 ? [...M] : Array.from(
|
|
128
|
+
{ length: 10 },
|
|
129
|
+
(e, t) => o[t % o.length]
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
const H = /* @__PURE__ */ new Set(), Y = ["#c7cad0", "#d0d3d8", "#d8dade", "#dfe1e4", "#e6e7e9"], w = 0, W = (
|
|
126
133
|
/* glsl */
|
|
127
134
|
`
|
|
128
135
|
attribute vec2 uv;
|
|
@@ -135,7 +142,7 @@ const R = {
|
|
|
135
142
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
136
143
|
}
|
|
137
144
|
`
|
|
138
|
-
),
|
|
145
|
+
), $ = (
|
|
139
146
|
/* glsl */
|
|
140
147
|
`
|
|
141
148
|
precision highp float;
|
|
@@ -197,7 +204,7 @@ const R = {
|
|
|
197
204
|
}
|
|
198
205
|
|
|
199
206
|
void main() {
|
|
200
|
-
const float padding = ${
|
|
207
|
+
const float padding = ${w.toFixed(4)};
|
|
201
208
|
vec2 iconUv = (vUv - padding) / (1.0 - padding * 2.0);
|
|
202
209
|
|
|
203
210
|
if (iconUv.x < 0.0 || iconUv.x > 1.0 || iconUv.y < 0.0 || iconUv.y > 1.0) {
|
|
@@ -322,13 +329,25 @@ const R = {
|
|
|
322
329
|
directCell * hoverMotion,
|
|
323
330
|
(1.0 - smoothstep(0.15, 2.85, cellDistance)) * hoverMotion
|
|
324
331
|
);
|
|
332
|
+
float hoverAura = (1.0 - smoothstep(0.0, 4.2, cellDistance)) * hoverMotion;
|
|
333
|
+
float hoverBreath = 0.5 + 0.5 * sin(uHoverTime * 4.6 - cellDistance * 0.7);
|
|
325
334
|
|
|
326
335
|
float tileScale = 0.82;
|
|
327
336
|
vec2 springShape = vec2(1.0);
|
|
328
337
|
float angle = 0.0;
|
|
329
338
|
vec2 tileOffset = vec2(0.0);
|
|
330
339
|
|
|
331
|
-
tileScale += radialGrowMode *
|
|
340
|
+
tileScale += radialGrowMode * (
|
|
341
|
+
radialGrow * 0.2 + hoverAura * hoverBreath * 0.055
|
|
342
|
+
);
|
|
343
|
+
springShape += radialGrowMode * vec2(
|
|
344
|
+
-hoverAura * 0.02,
|
|
345
|
+
hoverAura * 0.045
|
|
346
|
+
);
|
|
347
|
+
angle += radialGrowMode
|
|
348
|
+
* sin(uHoverTime * 3.8 - cellDistance)
|
|
349
|
+
* hoverAura
|
|
350
|
+
* 0.075;
|
|
332
351
|
|
|
333
352
|
tileScale += mode0 * (directCell * hoverMotion * 0.075 + colorRipple * 0.045);
|
|
334
353
|
|
|
@@ -350,7 +369,7 @@ const R = {
|
|
|
350
369
|
springShape += mode3 * vec2(-radialEcho * 0.055, radialEcho * 0.08);
|
|
351
370
|
angle += mode3 * sin(blastDistance * 1.8 + uBlastTime * 3.0) * radialEcho * 0.12;
|
|
352
371
|
tileScale += mode3 * (
|
|
353
|
-
blastRing * 0.
|
|
372
|
+
blastRing * 0.26 - blastCore * 0.18 + abs(blastShake) * 0.075
|
|
354
373
|
);
|
|
355
374
|
springShape += mode3 * vec2(-blastRing * 0.055, blastRing * 0.075);
|
|
356
375
|
angle += mode3 * (
|
|
@@ -470,6 +489,11 @@ const R = {
|
|
|
470
489
|
magneticColor,
|
|
471
490
|
mode2 * clamp(max(magneticField * 0.72, directCell * hoverMotion * 0.72), 0.0, 0.82)
|
|
472
491
|
);
|
|
492
|
+
color = mix(
|
|
493
|
+
color,
|
|
494
|
+
interactionColor,
|
|
495
|
+
mode3 * clamp(hoverAura * (0.28 + hoverBreath * 0.18), 0.0, 0.68)
|
|
496
|
+
);
|
|
473
497
|
color = mix(
|
|
474
498
|
color,
|
|
475
499
|
echoColor,
|
|
@@ -499,99 +523,99 @@ const R = {
|
|
|
499
523
|
), y = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)") : {
|
|
500
524
|
matches: !1
|
|
501
525
|
};
|
|
502
|
-
function
|
|
503
|
-
const e = Number.parseInt(
|
|
526
|
+
function p(o) {
|
|
527
|
+
const e = Number.parseInt(o.slice(1), 16);
|
|
504
528
|
return [
|
|
505
529
|
(e >> 16 & 255) / 255,
|
|
506
530
|
(e >> 8 & 255) / 255,
|
|
507
531
|
(e & 255) / 255
|
|
508
532
|
];
|
|
509
533
|
}
|
|
510
|
-
function E(
|
|
511
|
-
var
|
|
512
|
-
const
|
|
513
|
-
return
|
|
534
|
+
function E(o, e) {
|
|
535
|
+
var s;
|
|
536
|
+
const t = (s = o.match(/^var\((--[^)]+)\)$/)) == null ? void 0 : s[1];
|
|
537
|
+
return t ? getComputedStyle(e).getPropertyValue(t).trim() : o;
|
|
514
538
|
}
|
|
515
|
-
function L(
|
|
516
|
-
const e =
|
|
539
|
+
function L(o) {
|
|
540
|
+
const e = o.length, t = o[0].length, s = Array.from(
|
|
517
541
|
{ length: e },
|
|
518
|
-
() => Array(
|
|
519
|
-
), c = [],
|
|
520
|
-
|
|
542
|
+
() => Array(t).fill(!1)
|
|
543
|
+
), c = [], n = (r, l) => {
|
|
544
|
+
r < 0 || r >= e || l < 0 || l >= t || s[r][l] || o[r][l] === "#" || (s[r][l] = !0, c.push([r, l]));
|
|
521
545
|
};
|
|
522
|
-
for (let
|
|
523
|
-
|
|
524
|
-
for (let
|
|
525
|
-
|
|
526
|
-
for (let
|
|
527
|
-
const [
|
|
528
|
-
l
|
|
546
|
+
for (let r = 0; r < t; r += 1)
|
|
547
|
+
n(0, r), n(e - 1, r);
|
|
548
|
+
for (let r = 0; r < e; r += 1)
|
|
549
|
+
n(r, 0), n(r, t - 1);
|
|
550
|
+
for (let r = 0; r < c.length; r += 1) {
|
|
551
|
+
const [l, h] = c[r];
|
|
552
|
+
n(l - 1, h), n(l + 1, h), n(l, h - 1), n(l, h + 1);
|
|
529
553
|
}
|
|
530
|
-
return
|
|
531
|
-
(
|
|
554
|
+
return o.map(
|
|
555
|
+
(r, l) => [...r].map((h, a) => h === "#" ? 2 : s[l][a] ? 0 : 1)
|
|
532
556
|
);
|
|
533
557
|
}
|
|
534
|
-
function
|
|
535
|
-
const
|
|
536
|
-
for (let
|
|
537
|
-
const
|
|
538
|
-
for (let
|
|
539
|
-
const
|
|
540
|
-
|
|
558
|
+
function J(o, e, t, s, c) {
|
|
559
|
+
const n = e.length, r = e[0].length, l = new Uint8Array(r * n * 4);
|
|
560
|
+
for (let h = 0; h < n; h += 1) {
|
|
561
|
+
const a = n - 1 - h;
|
|
562
|
+
for (let u = 0; u < r; u += 1) {
|
|
563
|
+
const d = (h * r + u) * 4, m = s[a][u], v = m === 2 || c && m === 0;
|
|
564
|
+
l[d] = v ? 255 : 0, l[d + 1] = v ? (u * 3 + h * 7 + t) % 10 : 0, l[d + 2] = m === 2 ? 255 : m === 1 ? 128 : 0, l[d + 3] = 255;
|
|
541
565
|
}
|
|
542
566
|
}
|
|
543
|
-
return new
|
|
544
|
-
image:
|
|
545
|
-
width:
|
|
546
|
-
height:
|
|
547
|
-
format:
|
|
548
|
-
internalFormat:
|
|
567
|
+
return new q(o, {
|
|
568
|
+
image: l,
|
|
569
|
+
width: r,
|
|
570
|
+
height: n,
|
|
571
|
+
format: o.RGBA,
|
|
572
|
+
internalFormat: o.RGBA,
|
|
549
573
|
generateMipmaps: !1,
|
|
550
|
-
minFilter:
|
|
551
|
-
magFilter:
|
|
574
|
+
minFilter: o.NEAREST,
|
|
575
|
+
magFilter: o.NEAREST,
|
|
552
576
|
flipY: !1,
|
|
553
577
|
unpackAlignment: 1
|
|
554
578
|
});
|
|
555
579
|
}
|
|
556
|
-
function
|
|
557
|
-
const
|
|
558
|
-
return !!(
|
|
580
|
+
function j() {
|
|
581
|
+
const o = document.createElement("canvas");
|
|
582
|
+
return !!(o.getContext("webgl2") || o.getContext("webgl"));
|
|
559
583
|
}
|
|
560
|
-
function
|
|
561
|
-
const e =
|
|
562
|
-
let
|
|
563
|
-
return
|
|
564
|
-
[...
|
|
565
|
-
if (
|
|
566
|
-
const
|
|
567
|
-
|
|
584
|
+
function Q(o) {
|
|
585
|
+
const e = o[0].length, t = o.length;
|
|
586
|
+
let s = [0.5, 0.5], c = 1 / 0;
|
|
587
|
+
return o.forEach((n, r) => {
|
|
588
|
+
[...n].forEach((l, h) => {
|
|
589
|
+
if (l !== "#") return;
|
|
590
|
+
const a = (h + 0.5) / e, u = 1 - (r + 0.5) / t, d = (a - 0.5) ** 2 + (u - 0.5) ** 2;
|
|
591
|
+
d < c && (c = d, s = [a, u]);
|
|
568
592
|
});
|
|
569
|
-
}),
|
|
593
|
+
}), s;
|
|
570
594
|
}
|
|
571
|
-
function
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
(
|
|
595
|
+
function Z(o, e, t, s, c) {
|
|
596
|
+
o.classList.add("is-fallback");
|
|
597
|
+
const n = document.createElement("canvas"), r = 600, l = 63, h = (r - l * 2) / e[0].length, a = n.getContext("2d");
|
|
598
|
+
if (!a) return;
|
|
599
|
+
n.width = r, n.height = r;
|
|
600
|
+
const u = L(e), d = t.map(
|
|
601
|
+
(m) => E(m, o)
|
|
578
602
|
);
|
|
579
|
-
e.forEach((
|
|
580
|
-
[...
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
583
|
-
const x = (
|
|
584
|
-
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
for (let
|
|
588
|
-
|
|
589
|
-
|
|
603
|
+
e.forEach((m, v) => {
|
|
604
|
+
[...m].forEach((b, f) => {
|
|
605
|
+
const g = u[v][f];
|
|
606
|
+
if (g === 1 || !c && g !== 2) return;
|
|
607
|
+
const x = (f * 3 + (e.length - 1 - v) * 7 + s) % t.length, k = g === 2 ? d : Y, T = h * 0.08, S = l + f * h + T, B = l + v * h + T, C = h - T * 2;
|
|
608
|
+
a.save(), a.beginPath(), a.rect(S, B, C, C), a.clip(), a.globalAlpha = g === 2 ? 1 : 0.1, a.strokeStyle = k[x];
|
|
609
|
+
const G = o.classList.contains("pixel-icon--hero") ? 0.095 : 0.13;
|
|
610
|
+
a.lineWidth = Math.max(1.5, C * G);
|
|
611
|
+
for (let A = -C; A < C * 2; A += C * 0.16)
|
|
612
|
+
a.beginPath(), a.moveTo(S + A, B), a.lineTo(S + A - C, B + C), a.stroke();
|
|
613
|
+
a.restore();
|
|
590
614
|
});
|
|
591
|
-
}),
|
|
615
|
+
}), o.append(n);
|
|
592
616
|
}
|
|
593
|
-
class
|
|
594
|
-
constructor(e,
|
|
617
|
+
class ee {
|
|
618
|
+
constructor(e, t, s, c, n, r = "tiles") {
|
|
595
619
|
i(this, "root");
|
|
596
620
|
i(this, "surface");
|
|
597
621
|
i(this, "maskName");
|
|
@@ -600,6 +624,7 @@ class Z {
|
|
|
600
624
|
i(this, "cellKinds");
|
|
601
625
|
i(this, "seed");
|
|
602
626
|
i(this, "palette");
|
|
627
|
+
i(this, "interactionArea");
|
|
603
628
|
i(this, "focusPoint");
|
|
604
629
|
i(this, "hoverTarget", 0);
|
|
605
630
|
i(this, "hover", 0);
|
|
@@ -631,7 +656,9 @@ class Z {
|
|
|
631
656
|
i(this, "onFocus");
|
|
632
657
|
i(this, "onBlur");
|
|
633
658
|
i(this, "onClick");
|
|
634
|
-
this.root = e, this.surface = e.closest(".pixel-surface") || e, this.maskName = e.dataset.mask && e.dataset.mask in
|
|
659
|
+
this.root = e, this.surface = e.closest(".pixel-surface") || e, this.maskName = e.dataset.mask && e.dataset.mask in P ? e.dataset.mask : "growth", this.rows = P[this.maskName], this.boxed = H.has(this.maskName), this.cellKinds = L(this.rows), this.seed = t * 13 + 7, this.palette = F(
|
|
660
|
+
n != null && n.length ? n : R[this.maskName] || R.growth
|
|
661
|
+
), this.interactionArea = r, this.focusPoint = Q(this.rows), this.intro = y.matches ? 1 : 0, this.startedAt = performance.now(), this.lastFrameTime = this.startedAt, this.motionMode = e.classList.contains("pixel-icon--hero") ? 3 : s, this.canvas = document.createElement("canvas"), this.canvas.setAttribute("aria-hidden", "true"), e.append(this.canvas), this.renderer = new K({
|
|
635
662
|
canvas: this.canvas,
|
|
636
663
|
dpr: Math.min(window.devicePixelRatio || 1, 2),
|
|
637
664
|
alpha: !0,
|
|
@@ -640,18 +667,18 @@ class Z {
|
|
|
640
667
|
premultipliedAlpha: !1,
|
|
641
668
|
powerPreference: "high-performance"
|
|
642
669
|
}), this.gl = this.renderer.gl, this.gl.clearColor(0, 0, 0, 0);
|
|
643
|
-
const l =
|
|
670
|
+
const l = J(
|
|
644
671
|
this.gl,
|
|
645
672
|
this.rows,
|
|
646
673
|
this.seed,
|
|
647
674
|
this.cellKinds,
|
|
648
675
|
this.boxed
|
|
649
|
-
),
|
|
650
|
-
(
|
|
651
|
-
),
|
|
652
|
-
this.program = new
|
|
653
|
-
vertex:
|
|
654
|
-
fragment:
|
|
676
|
+
), h = new U(this.gl), a = this.palette.map(
|
|
677
|
+
(d) => E(d, e)
|
|
678
|
+
), u = c ? E(c, e) : null;
|
|
679
|
+
this.program = new _(this.gl, {
|
|
680
|
+
vertex: W,
|
|
681
|
+
fragment: $,
|
|
655
682
|
transparent: !0,
|
|
656
683
|
depthTest: !1,
|
|
657
684
|
depthWrite: !1,
|
|
@@ -674,44 +701,44 @@ class Z {
|
|
|
674
701
|
uGapInner: { value: 0.13 },
|
|
675
702
|
uGapOuter: { value: 0.19 },
|
|
676
703
|
uMode: { value: this.motionMode },
|
|
677
|
-
uColor0: { value:
|
|
678
|
-
uColor1: { value:
|
|
679
|
-
uColor2: { value:
|
|
680
|
-
uColor3: { value:
|
|
681
|
-
uColor4: { value:
|
|
682
|
-
uColor5: { value:
|
|
683
|
-
uColor6: { value:
|
|
684
|
-
uColor7: { value:
|
|
685
|
-
uColor8: { value:
|
|
686
|
-
uColor9: { value:
|
|
704
|
+
uColor0: { value: p(a[0]) },
|
|
705
|
+
uColor1: { value: p(a[1]) },
|
|
706
|
+
uColor2: { value: p(a[2]) },
|
|
707
|
+
uColor3: { value: p(a[3]) },
|
|
708
|
+
uColor4: { value: p(a[4]) },
|
|
709
|
+
uColor5: { value: p(a[5]) },
|
|
710
|
+
uColor6: { value: p(a[6]) },
|
|
711
|
+
uColor7: { value: p(a[7]) },
|
|
712
|
+
uColor8: { value: p(a[8]) },
|
|
713
|
+
uColor9: { value: p(a[9]) },
|
|
687
714
|
uInteractionColor: {
|
|
688
|
-
value:
|
|
715
|
+
value: u ? p(u) : [0, 0, 0]
|
|
689
716
|
},
|
|
690
|
-
uUseInteractionColor: { value:
|
|
717
|
+
uUseInteractionColor: { value: u ? 1 : 0 }
|
|
691
718
|
}
|
|
692
|
-
}), this.mesh = new
|
|
719
|
+
}), this.mesh = new N(this.gl, { geometry: h, program: this.program }), this.bindEvents(), this.observe(), this.resize();
|
|
693
720
|
}
|
|
694
|
-
getPointerHit(e,
|
|
695
|
-
const
|
|
696
|
-
let
|
|
697
|
-
if (
|
|
698
|
-
const
|
|
699
|
-
|
|
721
|
+
getPointerHit(e, t) {
|
|
722
|
+
const s = this.root.getBoundingClientRect(), c = 1 - w * 2, n = (e - s.left) / s.width, r = (t - s.top) / s.height, l = (n - w) / c, h = (r - w) / c, a = l >= 0 && l < 1 && h >= 0 && h < 1;
|
|
723
|
+
let u = !1, d = null;
|
|
724
|
+
if (a) {
|
|
725
|
+
const m = this.rows[0].length, v = this.rows.length, b = l * m, f = h * v, g = Math.floor(b), x = Math.floor(f), k = b - g, T = f - x, S = Math.abs(k - 0.5) <= 0.43 && Math.abs(T - 0.5) <= 0.43;
|
|
726
|
+
u = this.interactionArea === "surface" || S && this.cellKinds[x][g] === 2, u && (d = `${x}:${g}`);
|
|
700
727
|
}
|
|
701
|
-
return { iconX:
|
|
728
|
+
return { iconX: l, iconYTop: h, isTileHit: u, tileKey: d };
|
|
702
729
|
}
|
|
703
730
|
bindEvents() {
|
|
704
731
|
this.onPointerLeave = () => {
|
|
705
732
|
this.hoverTarget = 0, this.pointerTarget[0] = 0.5, this.pointerTarget[1] = 0.5, this.hoverAge = 0, this.hoveredTileKey = null, this.pointerTileKey = null, this.pointerDownSource = null, this.hadPointerDown = !1, this.surface.classList.remove("is-over-tile");
|
|
706
733
|
}, this.onPointerMove = (e) => {
|
|
707
|
-
const { iconX:
|
|
734
|
+
const { iconX: t, iconYTop: s, isTileHit: c, tileKey: n } = this.getPointerHit(
|
|
708
735
|
e.clientX,
|
|
709
736
|
e.clientY
|
|
710
737
|
);
|
|
711
|
-
|
|
738
|
+
n !== this.hoveredTileKey && (this.hoverAge = 0), this.hoveredTileKey = n, this.pointerTileKey = n, this.hoverTarget = c ? 1 : 0, this.surface.classList.toggle("is-over-tile", c), c ? (this.pointerTarget[0] = t, this.pointerTarget[1] = 1 - s) : (this.pointerTarget[0] = 0.5, this.pointerTarget[1] = 0.5);
|
|
712
739
|
}, this.onPointerDown = (e) => {
|
|
713
|
-
const
|
|
714
|
-
this.hadPointerDown = !0, this.pointerDownSource =
|
|
740
|
+
const t = this.getPointerHit(e.clientX, e.clientY);
|
|
741
|
+
this.hadPointerDown = !0, this.pointerDownSource = t.isTileHit ? [t.iconX, 1 - t.iconYTop] : null;
|
|
715
742
|
}, this.onFocus = () => {
|
|
716
743
|
this.hadPointerDown || (this.hoverTarget = 1, this.hoverAge = 0, this.hoveredTileKey = "focus", this.pointerTarget[0] = this.focusPoint[0], this.pointerTarget[1] = this.focusPoint[1]);
|
|
717
744
|
}, this.onBlur = () => {
|
|
@@ -730,83 +757,103 @@ class Z {
|
|
|
730
757
|
), this.intersectionObserver.observe(this.root);
|
|
731
758
|
}
|
|
732
759
|
resize() {
|
|
733
|
-
const e = this.root.getBoundingClientRect(),
|
|
734
|
-
this.renderer.setSize(
|
|
760
|
+
const e = this.root.getBoundingClientRect(), t = Math.max(1, Math.round(Math.min(e.width, e.height))), s = Math.max(this.rows[0].length, this.rows.length), c = t * (1 - w * 2) / s, n = Math.min(1, Math.max(0, (c - 12) / 4.5));
|
|
761
|
+
this.renderer.setSize(t, t), this.program.uniforms.uStripeFrequency.value = 2 + (4.455 - 2) * n, this.program.uniforms.uGapInner.value = 0.13, this.program.uniforms.uGapOuter.value = 0.2 + (0.19 - 0.2) * n;
|
|
735
762
|
}
|
|
736
763
|
update(e) {
|
|
737
|
-
const
|
|
764
|
+
const t = Math.min(
|
|
738
765
|
0.05,
|
|
739
766
|
Math.max(0, (e - this.lastFrameTime) * 1e-3)
|
|
740
767
|
);
|
|
741
768
|
if (this.lastFrameTime = e, !this.visible) return;
|
|
742
|
-
const
|
|
743
|
-
this.hoverAge = this.hoverTarget > 0 ? this.hoverAge +
|
|
769
|
+
const s = (e - this.startedAt) * 1e-3, c = y.matches ? 0 : 1;
|
|
770
|
+
this.hoverAge = this.hoverTarget > 0 ? this.hoverAge + t : 0, this.blastActive > 0 && (this.blastAge += t, this.blastAge >= 1.35 && (this.blastActive = 0)), this.hover += (this.hoverTarget - this.hover) * (this.hoverTarget > this.hover ? 0.1 : 0.07), this.pointer[0] += (this.pointerTarget[0] - this.pointer[0]) * 0.1, this.pointer[1] += (this.pointerTarget[1] - this.pointer[1]) * 0.1, this.intro = c ? Math.min(1, s / 1.7) : 1, this.program.uniforms.uTime.value = s, this.program.uniforms.uHoverTime.value = this.hoverAge, this.program.uniforms.uHover.value = this.hover, this.program.uniforms.uBlastTime.value = this.blastAge, this.program.uniforms.uBlast.value = this.blastActive, this.program.uniforms.uIntro.value = this.intro, this.program.uniforms.uMotion.value = c, this.renderer.render({ scene: this.mesh });
|
|
744
771
|
}
|
|
745
772
|
destroy() {
|
|
746
|
-
var
|
|
747
|
-
(
|
|
773
|
+
var t, s;
|
|
774
|
+
(t = this.resizeObserver) == null || t.disconnect(), (s = this.intersectionObserver) == null || s.disconnect(), this.surface.removeEventListener("pointerleave", this.onPointerLeave), this.surface.removeEventListener("pointermove", this.onPointerMove), this.surface.removeEventListener("pointerdown", this.onPointerDown), this.surface.removeEventListener("focus", this.onFocus), this.surface.removeEventListener("blur", this.onBlur), this.surface.removeEventListener("click", this.onClick);
|
|
748
775
|
const e = this.gl.getExtension("WEBGL_lose_context");
|
|
749
776
|
e == null || e.loseContext();
|
|
750
777
|
}
|
|
751
778
|
}
|
|
752
|
-
const
|
|
779
|
+
const te = D.forwardRef(
|
|
753
780
|
({
|
|
754
|
-
mask:
|
|
781
|
+
mask: o = "growth",
|
|
755
782
|
motion: e = "sequence",
|
|
756
|
-
motionMode:
|
|
757
|
-
interactionColor:
|
|
758
|
-
|
|
783
|
+
motionMode: t = 3,
|
|
784
|
+
interactionColor: s,
|
|
785
|
+
palette: c,
|
|
786
|
+
interactionArea: n = "tiles",
|
|
787
|
+
hero: r = !1,
|
|
759
788
|
className: l,
|
|
760
|
-
...
|
|
761
|
-
},
|
|
762
|
-
const
|
|
763
|
-
(
|
|
764
|
-
|
|
789
|
+
...h
|
|
790
|
+
}, a) => {
|
|
791
|
+
const u = D.useRef(null), d = D.useCallback(
|
|
792
|
+
(m) => {
|
|
793
|
+
u.current = m, typeof a == "function" ? a(m) : a && (a.current = m);
|
|
765
794
|
},
|
|
766
|
-
[
|
|
795
|
+
[a]
|
|
767
796
|
);
|
|
768
|
-
return
|
|
769
|
-
const
|
|
770
|
-
if (!
|
|
771
|
-
let
|
|
772
|
-
if (
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
797
|
+
return D.useEffect(() => {
|
|
798
|
+
const m = u.current;
|
|
799
|
+
if (!m) return;
|
|
800
|
+
let v = null, b = 0;
|
|
801
|
+
if (j()) {
|
|
802
|
+
v = new ee(
|
|
803
|
+
m,
|
|
804
|
+
0,
|
|
805
|
+
t,
|
|
806
|
+
s,
|
|
807
|
+
c,
|
|
808
|
+
n
|
|
809
|
+
);
|
|
810
|
+
const f = (g) => {
|
|
811
|
+
v == null || v.update(g), b = window.requestAnimationFrame(f);
|
|
776
812
|
};
|
|
777
|
-
|
|
813
|
+
b = window.requestAnimationFrame(f);
|
|
778
814
|
} else {
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
815
|
+
const f = o in P ? o : "growth";
|
|
816
|
+
Z(
|
|
817
|
+
m,
|
|
818
|
+
P[f],
|
|
819
|
+
F(
|
|
820
|
+
c != null && c.length ? c : R[f] || R.growth
|
|
821
|
+
),
|
|
784
822
|
7,
|
|
785
|
-
|
|
823
|
+
H.has(f)
|
|
786
824
|
);
|
|
787
825
|
}
|
|
788
826
|
return () => {
|
|
789
|
-
|
|
827
|
+
b && window.cancelAnimationFrame(b), v == null || v.destroy(), m.replaceChildren(), m.classList.remove("is-fallback");
|
|
790
828
|
};
|
|
791
|
-
}, [
|
|
829
|
+
}, [
|
|
830
|
+
o,
|
|
831
|
+
e,
|
|
832
|
+
t,
|
|
833
|
+
s,
|
|
834
|
+
c,
|
|
835
|
+
n,
|
|
836
|
+
r
|
|
837
|
+
]), /* @__PURE__ */ z(
|
|
792
838
|
"span",
|
|
793
839
|
{
|
|
794
|
-
ref:
|
|
840
|
+
ref: d,
|
|
795
841
|
"aria-hidden": !0,
|
|
796
842
|
"data-pixel-icon": !0,
|
|
797
|
-
"data-mask":
|
|
843
|
+
"data-mask": o,
|
|
798
844
|
"data-motion": e,
|
|
799
|
-
className:
|
|
845
|
+
className: V(
|
|
800
846
|
"pixel-surface pixel-icon relative block outline-none [&_canvas]:block [&_canvas]:size-full",
|
|
801
|
-
|
|
847
|
+
n === "surface" && "cursor-crosshair",
|
|
848
|
+
r && "pixel-icon--hero",
|
|
802
849
|
l
|
|
803
850
|
),
|
|
804
|
-
...
|
|
851
|
+
...h
|
|
805
852
|
}
|
|
806
853
|
);
|
|
807
854
|
}
|
|
808
855
|
);
|
|
809
|
-
|
|
856
|
+
te.displayName = "PixelIcon";
|
|
810
857
|
export {
|
|
811
|
-
|
|
858
|
+
te as PixelIcon
|
|
812
859
|
};
|
|
@@ -14,6 +14,7 @@ export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDiv
|
|
|
14
14
|
options: SegmentedOption[];
|
|
15
15
|
value: string;
|
|
16
16
|
onChange: (value: string) => void;
|
|
17
|
+
elevated?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
20
|
export {};
|