@egen-civitas/esm-styleguide 1.2.0 → 1.4.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/assistant/assistant-modes.d.ts +29 -0
  3. package/dist/assistant/assistant-modes.d.ts.map +1 -0
  4. package/dist/assistant/assistant-modes.js +143 -0
  5. package/dist/assistant/index.d.ts +9 -0
  6. package/dist/assistant/index.d.ts.map +1 -0
  7. package/dist/assistant/index.js +7 -0
  8. package/dist/assistant/live-orb.component.d.ts +63 -0
  9. package/dist/assistant/live-orb.component.d.ts.map +1 -0
  10. package/dist/assistant/live-orb.component.js +485 -0
  11. package/dist/assistant/prompt-input.component.d.ts +19 -0
  12. package/dist/assistant/prompt-input.component.d.ts.map +1 -0
  13. package/dist/assistant/prompt-input.component.js +1021 -0
  14. package/dist/assistant/recursive-erosion/recursive-erosion-background.component.d.ts +19 -0
  15. package/dist/assistant/recursive-erosion/recursive-erosion-background.component.d.ts.map +1 -0
  16. package/dist/assistant/recursive-erosion/recursive-erosion-background.component.js +127 -0
  17. package/dist/assistant/recursive-erosion/recursive-erosion-source.d.ts +2 -0
  18. package/dist/assistant/recursive-erosion/recursive-erosion-source.d.ts.map +1 -0
  19. package/dist/assistant/recursive-erosion/recursive-erosion-source.js +340 -0
  20. package/dist/assistant/spline-scene.component.d.ts +9 -0
  21. package/dist/assistant/spline-scene.component.d.ts.map +1 -0
  22. package/dist/assistant/spline-scene.component.js +51 -0
  23. package/dist/assistant/water-glass-modal.component.d.ts +26 -0
  24. package/dist/assistant/water-glass-modal.component.d.ts.map +1 -0
  25. package/dist/assistant/water-glass-modal.component.js +46 -0
  26. package/dist/assistant/xbox-audio.d.ts +88 -0
  27. package/dist/assistant/xbox-audio.d.ts.map +1 -0
  28. package/dist/assistant/xbox-audio.js +756 -0
  29. package/dist/components/_general.scss +52 -15
  30. package/dist/components/_panel-overrides.scss +5 -7
  31. package/dist/internal.d.ts +1 -0
  32. package/dist/internal.d.ts.map +1 -1
  33. package/dist/internal.js +1 -0
  34. package/dist/public.d.ts +1 -0
  35. package/dist/public.d.ts.map +1 -1
  36. package/dist/public.js +1 -0
  37. package/package.json +3 -1
@@ -0,0 +1,19 @@
1
+ import React, { type CSSProperties } from "react";
2
+ type EffectMode = "light" | "dark";
3
+ export type RecursiveErosionBackgroundProps = {
4
+ mode?: EffectMode;
5
+ hue?: number;
6
+ saturation?: number;
7
+ brightness?: number;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ };
11
+ export declare const RECURSIVE_EROSION_DEFAULTS: {
12
+ readonly mode: "dark";
13
+ readonly hue: 0;
14
+ readonly saturation: 1;
15
+ readonly brightness: 1;
16
+ };
17
+ export declare function RecursiveErosionBackground({ mode, hue, saturation, brightness, className, style, }: RecursiveErosionBackgroundProps): React.JSX.Element;
18
+ export default RecursiveErosionBackground;
19
+ //# sourceMappingURL=recursive-erosion-background.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursive-erosion-background.component.d.ts","sourceRoot":"","sources":["../../../src/assistant/recursive-erosion/recursive-erosion-background.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAW,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3D,KAAK,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAqBnC,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AA6FX,wBAAgB,0BAA0B,CAAC,EACzC,IAAsC,EACtC,GAAoC,EACpC,UAAkD,EAClD,UAAkD,EAClD,SAAS,EACT,KAAK,GACN,EAAE,+BAA+B,qBAkCjC;AAED,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import React, { useMemo } from "react";
4
+ import { recursiveErosionSource } from "./recursive-erosion-source.js";
5
+ export const RECURSIVE_EROSION_DEFAULTS = {
6
+ mode: "dark",
7
+ hue: 0,
8
+ saturation: 1,
9
+ brightness: 1
10
+ };
11
+ const RECURSIVE_EROSION_EFFECT = {
12
+ title: "Recursive Erosion particle sphere background",
13
+ source: recursiveErosionSource,
14
+ background: "#0a0908",
15
+ theme: {
16
+ lightBackground: "#f4f3f1",
17
+ darkBackground: "#0a0908"
18
+ },
19
+ targets: [
20
+ {
21
+ selector: "#stage",
22
+ role: "background"
23
+ }
24
+ ],
25
+ hiddenTargets: [
26
+ "#badge",
27
+ ".sr"
28
+ ]
29
+ };
30
+ function clamp(value, minimum, maximum) {
31
+ return Math.min(maximum, Math.max(minimum, value));
32
+ }
33
+ function effectBackground(definition, mode) {
34
+ return definition.theme?.[`${mode}Background`] ?? definition.background;
35
+ }
36
+ function buildFocusedDocument(definition, mode) {
37
+ const background = effectBackground(definition, mode);
38
+ const source = definition.source;
39
+ const targetJson = JSON.stringify(definition.targets).replace(/</g, "\\u003c");
40
+ const hiddenTargetJson = JSON.stringify(definition.hiddenTargets ?? []).replace(/</g, "\\u003c");
41
+ const modeJson = JSON.stringify(mode);
42
+ const focusStyle = `<style data-threeui-focus>
43
+ html, body { width: 100% !important; height: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; background: ${background} !important; color-scheme: ${mode} !important; }
44
+ body { position: relative !important; display: flex !important; align-items: center !important; justify-content: center !important; }
45
+ body > * { visibility: hidden !important; }
46
+ body[data-threeui-ready] > [data-threeui-role] { visibility: visible !important; }
47
+ [data-threeui-residual] { display: none !important; }
48
+ [data-threeui-hidden] { display: none !important; }
49
+ [data-threeui-role="background"] { position: fixed !important; inset: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; z-index: 0 !important; opacity: 1 !important; pointer-events: none !important; }
50
+ [data-threeui-role="button"] { position: relative !important; z-index: 2 !important; opacity: 1 !important; flex: none !important; }
51
+ [data-threeui-role="visual"] { position: relative !important; z-index: 1 !important; width: min(100%, 1040px) !important; max-width: 1040px !important; max-height: 100% !important; margin: auto !important; padding: 24px !important; overflow: auto !important; opacity: 1 !important; filter: none !important; }
52
+ </style>`;
53
+ const focusScript = `<script data-threeui-focus>
54
+ (function () {
55
+ document.documentElement.dataset.sfMode = ${modeJson};
56
+ var isolated = false;
57
+ function isolate() {
58
+ if (isolated) return;
59
+ var specs = ${targetJson};
60
+ var hiddenSelectors = ${hiddenTargetJson};
61
+ var roots = [];
62
+ hiddenSelectors.forEach(function (selector) {
63
+ document.querySelectorAll(selector).forEach(function (element) {
64
+ element.setAttribute('data-threeui-hidden', '');
65
+ element.setAttribute('aria-hidden', 'true');
66
+ if ('inert' in element) element.inert = true;
67
+ });
68
+ });
69
+ specs.forEach(function (spec) {
70
+ var element = document.querySelector(spec.selector);
71
+ if (!element) return;
72
+ element.setAttribute('data-threeui-role', spec.role);
73
+ if (!roots.some(function (root) { return root.contains(element); })) roots.push(element);
74
+ });
75
+ if (!roots.length) return;
76
+ isolated = true;
77
+ roots.forEach(function (root) {
78
+ var placeholderLink = root.matches('a[href="#"]') ? root : root.querySelector('a[href="#"]');
79
+ if (placeholderLink) placeholderLink.addEventListener('click', function (event) { event.preventDefault(); });
80
+ document.body.appendChild(root);
81
+ });
82
+ Array.from(document.body.children).forEach(function (element) {
83
+ if (roots.indexOf(element) !== -1) return;
84
+ element.setAttribute('data-threeui-residual', '');
85
+ element.setAttribute('aria-hidden', 'true');
86
+ if ('inert' in element) element.inert = true;
87
+ });
88
+ document.body.setAttribute('data-threeui-ready', '');
89
+ requestAnimationFrame(function () { window.dispatchEvent(new Event('resize')); });
90
+ }
91
+ function scheduleIsolation() { setTimeout(isolate, 100); }
92
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', scheduleIsolation, { once: true });
93
+ else scheduleIsolation();
94
+ window.addEventListener('load', isolate, { once: true });
95
+ })();
96
+ </script>`;
97
+ return source.replace(/<\/head>/i, `${focusStyle}</head>`).replace(/<\/body>/i, `${focusScript}</body>`);
98
+ }
99
+ export function RecursiveErosionBackground({ mode = RECURSIVE_EROSION_DEFAULTS.mode, hue = RECURSIVE_EROSION_DEFAULTS.hue, saturation = RECURSIVE_EROSION_DEFAULTS.saturation, brightness = RECURSIVE_EROSION_DEFAULTS.brightness, className, style }) {
100
+ const safeMode = mode === "light" ? "light" : "dark";
101
+ const background = effectBackground(RECURSIVE_EROSION_EFFECT, safeMode);
102
+ const source = useMemo(()=>buildFocusedDocument(RECURSIVE_EROSION_EFFECT, safeMode), [
103
+ safeMode
104
+ ]);
105
+ const safeHue = clamp(hue, -180, 180);
106
+ const safeSaturation = clamp(saturation, 0, 2);
107
+ const safeBrightness = clamp(brightness, 0.35, 1.65);
108
+ const filter = safeHue === 0 && safeSaturation === 1 && safeBrightness === 1 ? undefined : `hue-rotate(${safeHue}deg) saturate(${safeSaturation}) brightness(${safeBrightness})`;
109
+ return /*#__PURE__*/ _jsx("iframe", {
110
+ className: className,
111
+ "data-mode": safeMode,
112
+ title: RECURSIVE_EROSION_EFFECT.title,
113
+ srcDoc: source,
114
+ sandbox: "allow-scripts",
115
+ loading: "eager",
116
+ style: {
117
+ display: "block",
118
+ width: "100%",
119
+ height: "100%",
120
+ border: 0,
121
+ background,
122
+ filter,
123
+ ...style
124
+ }
125
+ });
126
+ }
127
+ export default RecursiveErosionBackground;
@@ -0,0 +1,2 @@
1
+ export declare const recursiveErosionSource = "<!DOCTYPE html>\n<html lang=\"fr\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Recursive Erosion Particle Sphere</title>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n html, body {\n width: 100%;\n height: 100%;\n overflow: hidden;\n background: #0a0908;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n #stage {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n }\n </style>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js\"></script>\n</head>\n<body>\n <canvas id=\"stage\"></canvas>\n\n <script>\n (function() {\n var canvas = document.getElementById('stage');\n var width = window.innerWidth;\n var height = window.innerHeight;\n\n // Ensure canvas has dimension\n canvas.width = width;\n canvas.height = height;\n\n // Mouse tracking\n var mouseX = 0, mouseY = 0;\n var targetRotX = 0, targetRotY = 0;\n window.addEventListener('mousemove', function(e) {\n mouseX = (e.clientX / window.innerWidth) * 2 - 1;\n mouseY = -(e.clientY / window.innerHeight) * 2 + 1;\n });\n\n // Simple 3D noise approximation\n function snoise(x, y, z) {\n return Math.sin(x * 1.7 + y * 2.3) * Math.cos(y * 1.5 + z * 2.1) * Math.sin(z * 1.9 + x * 0.9);\n }\n\n // Check if THREE is loaded\n if (typeof THREE !== 'undefined') {\n initThree();\n } else {\n // In case external CDN fails, fallback to standalone canvas 2D rendering\n initCanvasFallback();\n }\n\n function initThree() {\n var scene = new THREE.Scene();\n var camera = new THREE.PerspectiveCamera(50, width / height, 0.1, 1000);\n camera.position.z = 240;\n\n var renderer = new THREE.WebGLRenderer({\n canvas: canvas,\n antialias: true,\n alpha: true,\n powerPreference: \"high-performance\"\n });\n renderer.setSize(width, height);\n renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));\n\n // Create 7,000 points on Fibonacci sphere\n var particleCount = 7000;\n var geometry = new THREE.BufferGeometry();\n var positions = new Float32Array(particleCount * 3);\n var basePositions = new Float32Array(particleCount * 3);\n var colors = new Float32Array(particleCount * 3);\n var sizes = new Float32Array(particleCount);\n\n var sphereRadius = 82;\n var goldenRatio = (1 + Math.sqrt(5)) / 2;\n\n for (var i = 0; i < particleCount; i++) {\n var y = 1 - (i / (particleCount - 1)) * 2;\n var radiusAtY = Math.sqrt(Math.max(0, 1 - y * y));\n var theta = 2 * Math.PI * i / goldenRatio;\n\n var x = Math.cos(theta) * radiusAtY;\n var z = Math.sin(theta) * radiusAtY;\n\n var bx = x * sphereRadius;\n var by = y * sphereRadius;\n var bz = z * sphereRadius;\n\n basePositions[i * 3] = bx;\n basePositions[i * 3 + 1] = by;\n basePositions[i * 3 + 2] = bz;\n\n positions[i * 3] = bx;\n positions[i * 3 + 1] = by;\n positions[i * 3 + 2] = bz;\n\n // Warm orange / amber / golden palette with organic gradient\n var ratio = (y + 1) * 0.5;\n var r = 1.0;\n var g = 0.38 + ratio * 0.28 + Math.random() * 0.12;\n var b = 0.05 + ratio * 0.08;\n\n colors[i * 3] = r;\n colors[i * 3 + 1] = g;\n colors[i * 3 + 2] = b;\n\n sizes[i] = 1.2 + Math.random() * 2.0;\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n\n // Circular glow particle texture\n var circleCanvas = document.createElement('canvas');\n circleCanvas.width = 64;\n circleCanvas.height = 64;\n var ctx = circleCanvas.getContext('2d');\n var grad = ctx.createRadialGradient(32, 32, 0, 32, 32, 32);\n grad.addColorStop(0, 'rgba(255, 255, 255, 1)');\n grad.addColorStop(0.2, 'rgba(255, 160, 60, 0.9)');\n grad.addColorStop(0.5, 'rgba(255, 90, 20, 0.4)');\n grad.addColorStop(1, 'rgba(255, 60, 0, 0)');\n ctx.fillStyle = grad;\n ctx.fillRect(0, 0, 64, 64);\n\n var pTexture = new THREE.CanvasTexture(circleCanvas);\n\n var material = new THREE.PointsMaterial({\n size: 3.2,\n vertexColors: true,\n map: pTexture,\n transparent: true,\n blending: THREE.AdditiveBlending,\n depthWrite: false,\n opacity: 0.92\n });\n\n var points = new THREE.Points(geometry, material);\n scene.add(points);\n\n // 8 jagged lightning arcs that strike across the sphere\n var arcGroup = new THREE.Group();\n var arcLines = [];\n var ARC_COUNT = 8;\n var ARC_SEGMENTS = 20;\n\n for (var a = 0; a < ARC_COUNT; a++) {\n var arcGeo = new THREE.BufferGeometry();\n var arcPos = new Float32Array(ARC_SEGMENTS * 3);\n arcGeo.setAttribute('position', new THREE.BufferAttribute(arcPos, 3));\n\n var arcMat = new THREE.LineBasicMaterial({\n color: new THREE.Color(1.0, 0.72 + Math.random() * 0.25, 0.3),\n transparent: true,\n opacity: 0.75,\n blending: THREE.AdditiveBlending,\n linewidth: 1.5\n });\n\n var line = new THREE.Line(arcGeo, arcMat);\n arcLines.push({ line: line, geo: arcGeo, phase: Math.random() * Math.PI * 2, speed: 0.8 + Math.random() * 0.6 });\n arcGroup.add(line);\n }\n scene.add(arcGroup);\n\n // Inner glowing core\n var coreGeo = new THREE.SphereGeometry(sphereRadius * 0.3, 16, 16);\n var coreMat = new THREE.MeshBasicMaterial({\n color: 0xff5500,\n transparent: true,\n opacity: 0.08,\n blending: THREE.AdditiveBlending,\n wireframe: true\n });\n var coreMesh = new THREE.Mesh(coreGeo, coreMat);\n scene.add(coreMesh);\n\n var clock = new THREE.Clock();\n\n function animate() {\n requestAnimationFrame(animate);\n var time = clock.getElapsedTime();\n\n // 4-second erosion breathing loop\n var loopCycle = (time % 4.0) / 4.0; // 0 to 1\n var erosionPulse = Math.sin(loopCycle * Math.PI * 2);\n\n var posAttr = geometry.attributes.position;\n var posArray = posAttr.array;\n\n for (var i = 0; i < particleCount; i++) {\n var i3 = i * 3;\n var bx = basePositions[i3];\n var by = basePositions[i3 + 1];\n var bz = basePositions[i3 + 2];\n\n // 3D noise for recursive erosion crumpling & hole creation\n var nVal = snoise(bx * 0.025 + time * 0.4, by * 0.025 + time * 0.3, bz * 0.025);\n var isHole = nVal > (0.42 - erosionPulse * 0.25);\n\n var displace = isHole ? (1.0 + (nVal - 0.3) * 0.65) : (1.0 + nVal * 0.12 * erosionPulse);\n posArray[i3] = bx * displace;\n posArray[i3 + 1] = by * displace;\n posArray[i3 + 2] = bz * displace;\n }\n posAttr.needsUpdate = true;\n\n // Lightning arcs updates\n for (var a = 0; a < ARC_COUNT; a++) {\n var arcObj = arcLines[a];\n var aGeo = arcObj.geo;\n var aPos = aGeo.attributes.position.array;\n\n var tPhase = time * arcObj.speed + arcObj.phase;\n var p1Idx = Math.floor(Math.abs(Math.sin(tPhase * 0.7) * (particleCount - 1)));\n var p2Idx = Math.floor(Math.abs(Math.cos(tPhase * 0.5) * (particleCount - 1)));\n\n var x1 = posArray[p1Idx * 3], y1 = posArray[p1Idx * 3 + 1], z1 = posArray[p1Idx * 3 + 2];\n var x2 = posArray[p2Idx * 3], y2 = posArray[p2Idx * 3 + 1], z2 = posArray[p2Idx * 3 + 2];\n\n for (var s = 0; s < ARC_SEGMENTS; s++) {\n var tSeg = s / (ARC_SEGMENTS - 1);\n var sx = x1 + (x2 - x1) * tSeg;\n var sy = y1 + (y2 - y1) * tSeg;\n var sz = z1 + (z2 - z1) * tSeg;\n\n // Jagged lightning noise displacement\n if (s > 0 && s < ARC_SEGMENTS - 1) {\n var jitter = Math.sin(tSeg * Math.PI) * 7.5;\n sx += (Math.random() - 0.5) * jitter;\n sy += (Math.random() - 0.5) * jitter;\n sz += (Math.random() - 0.5) * jitter;\n }\n\n aPos[s * 3] = sx;\n aPos[s * 3 + 1] = sy;\n aPos[s * 3 + 2] = sz;\n }\n aGeo.attributes.position.needsUpdate = true;\n arcObj.line.material.opacity = 0.3 + Math.random() * 0.65;\n }\n\n // Smooth rotation & interactive mouse tilt\n targetRotX = mouseY * 0.45;\n targetRotY = mouseX * 0.55;\n\n points.rotation.y += 0.0035;\n points.rotation.x += (targetRotX - points.rotation.x) * 0.05;\n points.rotation.z += (targetRotY * 0.2 - points.rotation.z) * 0.05;\n\n arcGroup.rotation.copy(points.rotation);\n coreMesh.rotation.copy(points.rotation);\n\n renderer.render(scene, camera);\n }\n\n animate();\n\n window.addEventListener('resize', function() {\n width = window.innerWidth;\n height = window.innerHeight;\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n renderer.setSize(width, height);\n });\n }\n\n function initCanvasFallback() {\n var ctx = canvas.getContext('2d');\n var particles = [];\n var count = 3000;\n for (var i = 0; i < count; i++) {\n var y = 1 - (i / (count - 1)) * 2;\n var rAtY = Math.sqrt(Math.max(0, 1 - y * y));\n var theta = 2 * Math.PI * i / 1.6180339887;\n particles.push({\n x: Math.cos(theta) * rAtY,\n y: y,\n z: Math.sin(theta) * rAtY,\n baseRadius: 180\n });\n }\n\n var angleX = 0, angleY = 0;\n function renderLoop() {\n requestAnimationFrame(renderLoop);\n ctx.fillStyle = '#0a0908';\n ctx.fillRect(0, 0, width, height);\n\n var cx = width / 2;\n var cy = height / 2;\n\n angleY += 0.005;\n angleX = mouseY * 0.3;\n\n for (var i = 0; i < count; i += 2) {\n var p = particles[i];\n var cosY = Math.cos(angleY), sinY = Math.sin(angleY);\n var cosX = Math.cos(angleX), sinX = Math.sin(angleX);\n\n var x1 = p.x * cosY - p.z * sinY;\n var z1 = p.z * cosY + p.x * sinY;\n\n var y2 = p.y * cosX - z1 * sinX;\n var z2 = z1 * cosX + p.y * sinX;\n\n var scale = 400 / (400 + z2 * p.baseRadius);\n var px = cx + x1 * p.baseRadius * scale;\n var py = cy + y2 * p.baseRadius * scale;\n\n var alpha = Math.max(0.1, Math.min(1, (z2 + 1.2) * 0.45));\n ctx.fillStyle = 'rgba(255, 140, 40, ' + alpha + ')';\n ctx.beginPath();\n ctx.arc(px, py, Math.max(1, 2.0 * scale), 0, Math.PI * 2);\n ctx.fill();\n }\n }\n renderLoop();\n\n window.addEventListener('resize', function() {\n width = window.innerWidth;\n height = window.innerHeight;\n canvas.width = width;\n canvas.height = height;\n });\n }\n })();\n </script>\n</body>\n</html>";
2
+ //# sourceMappingURL=recursive-erosion-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursive-erosion-source.d.ts","sourceRoot":"","sources":["../../../src/assistant/recursive-erosion/recursive-erosion-source.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,uoXAmV3B,CAAC"}
@@ -0,0 +1,340 @@
1
+ export const recursiveErosionSource = `<!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Recursive Erosion Particle Sphere</title>
7
+ <style>
8
+ * { margin: 0; padding: 0; box-sizing: border-box; }
9
+ html, body {
10
+ width: 100%;
11
+ height: 100%;
12
+ overflow: hidden;
13
+ background: #0a0908;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ }
18
+ #stage {
19
+ position: absolute;
20
+ inset: 0;
21
+ width: 100%;
22
+ height: 100%;
23
+ display: block;
24
+ }
25
+ </style>
26
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
27
+ </head>
28
+ <body>
29
+ <canvas id="stage"></canvas>
30
+
31
+ <script>
32
+ (function() {
33
+ var canvas = document.getElementById('stage');
34
+ var width = window.innerWidth;
35
+ var height = window.innerHeight;
36
+
37
+ // Ensure canvas has dimension
38
+ canvas.width = width;
39
+ canvas.height = height;
40
+
41
+ // Mouse tracking
42
+ var mouseX = 0, mouseY = 0;
43
+ var targetRotX = 0, targetRotY = 0;
44
+ window.addEventListener('mousemove', function(e) {
45
+ mouseX = (e.clientX / window.innerWidth) * 2 - 1;
46
+ mouseY = -(e.clientY / window.innerHeight) * 2 + 1;
47
+ });
48
+
49
+ // Simple 3D noise approximation
50
+ function snoise(x, y, z) {
51
+ return Math.sin(x * 1.7 + y * 2.3) * Math.cos(y * 1.5 + z * 2.1) * Math.sin(z * 1.9 + x * 0.9);
52
+ }
53
+
54
+ // Check if THREE is loaded
55
+ if (typeof THREE !== 'undefined') {
56
+ initThree();
57
+ } else {
58
+ // In case external CDN fails, fallback to standalone canvas 2D rendering
59
+ initCanvasFallback();
60
+ }
61
+
62
+ function initThree() {
63
+ var scene = new THREE.Scene();
64
+ var camera = new THREE.PerspectiveCamera(50, width / height, 0.1, 1000);
65
+ camera.position.z = 240;
66
+
67
+ var renderer = new THREE.WebGLRenderer({
68
+ canvas: canvas,
69
+ antialias: true,
70
+ alpha: true,
71
+ powerPreference: "high-performance"
72
+ });
73
+ renderer.setSize(width, height);
74
+ renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
75
+
76
+ // Create 7,000 points on Fibonacci sphere
77
+ var particleCount = 7000;
78
+ var geometry = new THREE.BufferGeometry();
79
+ var positions = new Float32Array(particleCount * 3);
80
+ var basePositions = new Float32Array(particleCount * 3);
81
+ var colors = new Float32Array(particleCount * 3);
82
+ var sizes = new Float32Array(particleCount);
83
+
84
+ var sphereRadius = 82;
85
+ var goldenRatio = (1 + Math.sqrt(5)) / 2;
86
+
87
+ for (var i = 0; i < particleCount; i++) {
88
+ var y = 1 - (i / (particleCount - 1)) * 2;
89
+ var radiusAtY = Math.sqrt(Math.max(0, 1 - y * y));
90
+ var theta = 2 * Math.PI * i / goldenRatio;
91
+
92
+ var x = Math.cos(theta) * radiusAtY;
93
+ var z = Math.sin(theta) * radiusAtY;
94
+
95
+ var bx = x * sphereRadius;
96
+ var by = y * sphereRadius;
97
+ var bz = z * sphereRadius;
98
+
99
+ basePositions[i * 3] = bx;
100
+ basePositions[i * 3 + 1] = by;
101
+ basePositions[i * 3 + 2] = bz;
102
+
103
+ positions[i * 3] = bx;
104
+ positions[i * 3 + 1] = by;
105
+ positions[i * 3 + 2] = bz;
106
+
107
+ // Warm orange / amber / golden palette with organic gradient
108
+ var ratio = (y + 1) * 0.5;
109
+ var r = 1.0;
110
+ var g = 0.38 + ratio * 0.28 + Math.random() * 0.12;
111
+ var b = 0.05 + ratio * 0.08;
112
+
113
+ colors[i * 3] = r;
114
+ colors[i * 3 + 1] = g;
115
+ colors[i * 3 + 2] = b;
116
+
117
+ sizes[i] = 1.2 + Math.random() * 2.0;
118
+ }
119
+
120
+ geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
121
+ geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));
122
+
123
+ // Circular glow particle texture
124
+ var circleCanvas = document.createElement('canvas');
125
+ circleCanvas.width = 64;
126
+ circleCanvas.height = 64;
127
+ var ctx = circleCanvas.getContext('2d');
128
+ var grad = ctx.createRadialGradient(32, 32, 0, 32, 32, 32);
129
+ grad.addColorStop(0, 'rgba(255, 255, 255, 1)');
130
+ grad.addColorStop(0.2, 'rgba(255, 160, 60, 0.9)');
131
+ grad.addColorStop(0.5, 'rgba(255, 90, 20, 0.4)');
132
+ grad.addColorStop(1, 'rgba(255, 60, 0, 0)');
133
+ ctx.fillStyle = grad;
134
+ ctx.fillRect(0, 0, 64, 64);
135
+
136
+ var pTexture = new THREE.CanvasTexture(circleCanvas);
137
+
138
+ var material = new THREE.PointsMaterial({
139
+ size: 3.2,
140
+ vertexColors: true,
141
+ map: pTexture,
142
+ transparent: true,
143
+ blending: THREE.AdditiveBlending,
144
+ depthWrite: false,
145
+ opacity: 0.92
146
+ });
147
+
148
+ var points = new THREE.Points(geometry, material);
149
+ scene.add(points);
150
+
151
+ // 8 jagged lightning arcs that strike across the sphere
152
+ var arcGroup = new THREE.Group();
153
+ var arcLines = [];
154
+ var ARC_COUNT = 8;
155
+ var ARC_SEGMENTS = 20;
156
+
157
+ for (var a = 0; a < ARC_COUNT; a++) {
158
+ var arcGeo = new THREE.BufferGeometry();
159
+ var arcPos = new Float32Array(ARC_SEGMENTS * 3);
160
+ arcGeo.setAttribute('position', new THREE.BufferAttribute(arcPos, 3));
161
+
162
+ var arcMat = new THREE.LineBasicMaterial({
163
+ color: new THREE.Color(1.0, 0.72 + Math.random() * 0.25, 0.3),
164
+ transparent: true,
165
+ opacity: 0.75,
166
+ blending: THREE.AdditiveBlending,
167
+ linewidth: 1.5
168
+ });
169
+
170
+ var line = new THREE.Line(arcGeo, arcMat);
171
+ arcLines.push({ line: line, geo: arcGeo, phase: Math.random() * Math.PI * 2, speed: 0.8 + Math.random() * 0.6 });
172
+ arcGroup.add(line);
173
+ }
174
+ scene.add(arcGroup);
175
+
176
+ // Inner glowing core
177
+ var coreGeo = new THREE.SphereGeometry(sphereRadius * 0.3, 16, 16);
178
+ var coreMat = new THREE.MeshBasicMaterial({
179
+ color: 0xff5500,
180
+ transparent: true,
181
+ opacity: 0.08,
182
+ blending: THREE.AdditiveBlending,
183
+ wireframe: true
184
+ });
185
+ var coreMesh = new THREE.Mesh(coreGeo, coreMat);
186
+ scene.add(coreMesh);
187
+
188
+ var clock = new THREE.Clock();
189
+
190
+ function animate() {
191
+ requestAnimationFrame(animate);
192
+ var time = clock.getElapsedTime();
193
+
194
+ // 4-second erosion breathing loop
195
+ var loopCycle = (time % 4.0) / 4.0; // 0 to 1
196
+ var erosionPulse = Math.sin(loopCycle * Math.PI * 2);
197
+
198
+ var posAttr = geometry.attributes.position;
199
+ var posArray = posAttr.array;
200
+
201
+ for (var i = 0; i < particleCount; i++) {
202
+ var i3 = i * 3;
203
+ var bx = basePositions[i3];
204
+ var by = basePositions[i3 + 1];
205
+ var bz = basePositions[i3 + 2];
206
+
207
+ // 3D noise for recursive erosion crumpling & hole creation
208
+ var nVal = snoise(bx * 0.025 + time * 0.4, by * 0.025 + time * 0.3, bz * 0.025);
209
+ var isHole = nVal > (0.42 - erosionPulse * 0.25);
210
+
211
+ var displace = isHole ? (1.0 + (nVal - 0.3) * 0.65) : (1.0 + nVal * 0.12 * erosionPulse);
212
+ posArray[i3] = bx * displace;
213
+ posArray[i3 + 1] = by * displace;
214
+ posArray[i3 + 2] = bz * displace;
215
+ }
216
+ posAttr.needsUpdate = true;
217
+
218
+ // Lightning arcs updates
219
+ for (var a = 0; a < ARC_COUNT; a++) {
220
+ var arcObj = arcLines[a];
221
+ var aGeo = arcObj.geo;
222
+ var aPos = aGeo.attributes.position.array;
223
+
224
+ var tPhase = time * arcObj.speed + arcObj.phase;
225
+ var p1Idx = Math.floor(Math.abs(Math.sin(tPhase * 0.7) * (particleCount - 1)));
226
+ var p2Idx = Math.floor(Math.abs(Math.cos(tPhase * 0.5) * (particleCount - 1)));
227
+
228
+ var x1 = posArray[p1Idx * 3], y1 = posArray[p1Idx * 3 + 1], z1 = posArray[p1Idx * 3 + 2];
229
+ var x2 = posArray[p2Idx * 3], y2 = posArray[p2Idx * 3 + 1], z2 = posArray[p2Idx * 3 + 2];
230
+
231
+ for (var s = 0; s < ARC_SEGMENTS; s++) {
232
+ var tSeg = s / (ARC_SEGMENTS - 1);
233
+ var sx = x1 + (x2 - x1) * tSeg;
234
+ var sy = y1 + (y2 - y1) * tSeg;
235
+ var sz = z1 + (z2 - z1) * tSeg;
236
+
237
+ // Jagged lightning noise displacement
238
+ if (s > 0 && s < ARC_SEGMENTS - 1) {
239
+ var jitter = Math.sin(tSeg * Math.PI) * 7.5;
240
+ sx += (Math.random() - 0.5) * jitter;
241
+ sy += (Math.random() - 0.5) * jitter;
242
+ sz += (Math.random() - 0.5) * jitter;
243
+ }
244
+
245
+ aPos[s * 3] = sx;
246
+ aPos[s * 3 + 1] = sy;
247
+ aPos[s * 3 + 2] = sz;
248
+ }
249
+ aGeo.attributes.position.needsUpdate = true;
250
+ arcObj.line.material.opacity = 0.3 + Math.random() * 0.65;
251
+ }
252
+
253
+ // Smooth rotation & interactive mouse tilt
254
+ targetRotX = mouseY * 0.45;
255
+ targetRotY = mouseX * 0.55;
256
+
257
+ points.rotation.y += 0.0035;
258
+ points.rotation.x += (targetRotX - points.rotation.x) * 0.05;
259
+ points.rotation.z += (targetRotY * 0.2 - points.rotation.z) * 0.05;
260
+
261
+ arcGroup.rotation.copy(points.rotation);
262
+ coreMesh.rotation.copy(points.rotation);
263
+
264
+ renderer.render(scene, camera);
265
+ }
266
+
267
+ animate();
268
+
269
+ window.addEventListener('resize', function() {
270
+ width = window.innerWidth;
271
+ height = window.innerHeight;
272
+ camera.aspect = width / height;
273
+ camera.updateProjectionMatrix();
274
+ renderer.setSize(width, height);
275
+ });
276
+ }
277
+
278
+ function initCanvasFallback() {
279
+ var ctx = canvas.getContext('2d');
280
+ var particles = [];
281
+ var count = 3000;
282
+ for (var i = 0; i < count; i++) {
283
+ var y = 1 - (i / (count - 1)) * 2;
284
+ var rAtY = Math.sqrt(Math.max(0, 1 - y * y));
285
+ var theta = 2 * Math.PI * i / 1.6180339887;
286
+ particles.push({
287
+ x: Math.cos(theta) * rAtY,
288
+ y: y,
289
+ z: Math.sin(theta) * rAtY,
290
+ baseRadius: 180
291
+ });
292
+ }
293
+
294
+ var angleX = 0, angleY = 0;
295
+ function renderLoop() {
296
+ requestAnimationFrame(renderLoop);
297
+ ctx.fillStyle = '#0a0908';
298
+ ctx.fillRect(0, 0, width, height);
299
+
300
+ var cx = width / 2;
301
+ var cy = height / 2;
302
+
303
+ angleY += 0.005;
304
+ angleX = mouseY * 0.3;
305
+
306
+ for (var i = 0; i < count; i += 2) {
307
+ var p = particles[i];
308
+ var cosY = Math.cos(angleY), sinY = Math.sin(angleY);
309
+ var cosX = Math.cos(angleX), sinX = Math.sin(angleX);
310
+
311
+ var x1 = p.x * cosY - p.z * sinY;
312
+ var z1 = p.z * cosY + p.x * sinY;
313
+
314
+ var y2 = p.y * cosX - z1 * sinX;
315
+ var z2 = z1 * cosX + p.y * sinX;
316
+
317
+ var scale = 400 / (400 + z2 * p.baseRadius);
318
+ var px = cx + x1 * p.baseRadius * scale;
319
+ var py = cy + y2 * p.baseRadius * scale;
320
+
321
+ var alpha = Math.max(0.1, Math.min(1, (z2 + 1.2) * 0.45));
322
+ ctx.fillStyle = 'rgba(255, 140, 40, ' + alpha + ')';
323
+ ctx.beginPath();
324
+ ctx.arc(px, py, Math.max(1, 2.0 * scale), 0, Math.PI * 2);
325
+ ctx.fill();
326
+ }
327
+ }
328
+ renderLoop();
329
+
330
+ window.addEventListener('resize', function() {
331
+ width = window.innerWidth;
332
+ height = window.innerHeight;
333
+ canvas.width = width;
334
+ canvas.height = height;
335
+ });
336
+ }
337
+ })();
338
+ </script>
339
+ </body>
340
+ </html>`;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface SplineSceneProps {
3
+ scene: string;
4
+ className?: string;
5
+ onLoad?: (splineApp: unknown) => void;
6
+ }
7
+ export declare function SplineScene({ scene, className, onLoad }: SplineSceneProps): React.JSX.Element;
8
+ export default SplineScene;
9
+ //# sourceMappingURL=spline-scene.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spline-scene.component.d.ts","sourceRoot":"","sources":["../../src/assistant/spline-scene.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAiBD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAA2B,EAAE,MAAM,EAAE,EAAE,gBAAgB,qBA4B3F;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React, { useState } from "react";
4
+ import Spline from "@splinetool/react-spline";
5
+ // Global preload helper to pre-fetch the 1.3MB 3D scene immediately into browser cache
6
+ if (typeof window !== 'undefined') {
7
+ const PRELOAD_URL = "https://prod.spline.design/kZDDjO5HuC9GJUM2/scene.splinecode";
8
+ // Preload link tag
9
+ const link = document.createElement('link');
10
+ link.rel = 'preload';
11
+ link.as = 'fetch';
12
+ link.crossOrigin = 'anonymous';
13
+ link.href = PRELOAD_URL;
14
+ document.head.appendChild(link);
15
+ // Background fetch to cache it in memory
16
+ fetch(PRELOAD_URL, {
17
+ mode: 'cors'
18
+ }).catch(()=>{});
19
+ }
20
+ export function SplineScene({ scene, className = 'w-full h-full', onLoad }) {
21
+ const [isLoaded, setIsLoaded] = useState(false);
22
+ return /*#__PURE__*/ _jsxs("div", {
23
+ className: `relative ${className} overflow-hidden`,
24
+ children: [
25
+ !isLoaded && /*#__PURE__*/ _jsxs("div", {
26
+ className: "absolute inset-0 z-10 flex flex-col items-center justify-center bg-[#030708] text-teal-400 gap-3 transition-opacity duration-300",
27
+ children: [
28
+ /*#__PURE__*/ _jsx("div", {
29
+ className: "w-10 h-10 border-2 border-teal-400 border-t-transparent rounded-full animate-spin"
30
+ }),
31
+ /*#__PURE__*/ _jsx("span", {
32
+ className: "text-xs font-mono tracking-widest text-teal-300/80 uppercase animate-pulse",
33
+ children: "Initialisation Robot 3D..."
34
+ })
35
+ ]
36
+ }),
37
+ /*#__PURE__*/ _jsx("div", {
38
+ className: `w-full h-full transition-opacity duration-500 ${isLoaded ? 'opacity-100' : 'opacity-0'}`,
39
+ children: /*#__PURE__*/ _jsx(Spline, {
40
+ scene: scene,
41
+ className: "w-full h-full",
42
+ onLoad: (splineApp)=>{
43
+ setIsLoaded(true);
44
+ if (onLoad) onLoad(splineApp);
45
+ }
46
+ })
47
+ })
48
+ ]
49
+ });
50
+ }
51
+ export default SplineScene;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export interface WaterGlassModalProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ children?: React.ReactNode;
4
+ /** Option component/node if passed explicitly as requested */
5
+ optionsComponent?: React.ReactNode;
6
+ /** Header slot */
7
+ header?: React.ReactNode;
8
+ /** Footer slot */
9
+ footer?: React.ReactNode;
10
+ /** Alignment relative to parent container */
11
+ align?: 'left' | 'right' | 'center' | 'none';
12
+ /** Width class or inline size */
13
+ width?: string;
14
+ /** Additional container classes */
15
+ className?: string;
16
+ /** Content wrapper classes */
17
+ contentClassName?: string;
18
+ }
19
+ /**
20
+ * WaterGlassModal
21
+ * Composant de référence réutilisable pour tous les modals / popovers / menus déroulants
22
+ * Design Glassmorphism pur effet « eau transparente », sans fond blanc opaque.
23
+ */
24
+ export declare const WaterGlassModal: React.ForwardRefExoticComponent<WaterGlassModalProps & React.RefAttributes<HTMLDivElement>>;
25
+ export default WaterGlassModal;
26
+ //# sourceMappingURL=water-glass-modal.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"water-glass-modal.component.d.ts","sourceRoot":"","sources":["../../src/assistant/water-glass-modal.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAChF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,kBAAkB;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,kBAAkB;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7C,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,6FA2D3B,CAAC;AAIF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,46 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React, { forwardRef } from "react";
4
+ /**
5
+ * WaterGlassModal
6
+ * Composant de référence réutilisable pour tous les modals / popovers / menus déroulants
7
+ * Design Glassmorphism pur effet « eau transparente », sans fond blanc opaque.
8
+ */ export const WaterGlassModal = /*#__PURE__*/ forwardRef(({ children, optionsComponent, header, footer, align = 'right', width, className = '', contentClassName = '', ...rest }, ref)=>{
9
+ const alignmentClasses = {
10
+ right: 'right-0',
11
+ left: 'left-0',
12
+ center: 'left-1/2 -translate-x-1/2',
13
+ none: ''
14
+ }[align];
15
+ const hasPosition = className.includes('fixed') || className.includes('absolute');
16
+ const defaultPosition = hasPosition ? '' : 'absolute top-full mt-2';
17
+ return /*#__PURE__*/ _jsx("div", {
18
+ ref: ref,
19
+ className: `${defaultPosition} z-[9999] text-xs text-slate-100 select-none overflow-hidden
20
+ bg-slate-950/90 backdrop-blur-3xl rounded-2xl border border-white/20
21
+ shadow-[0_16px_48px_0_rgba(0,0,0,0.65)]
22
+ before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/[0.12] before:to-transparent before:pointer-events-none
23
+ animate-in fade-in zoom-in-95 duration-150
24
+ ${alignmentClasses}
25
+ ${width || ''}
26
+ ${className}
27
+ `,
28
+ ...rest,
29
+ children: /*#__PURE__*/ _jsxs("div", {
30
+ className: `relative z-10 p-1.5 ${contentClassName}`,
31
+ children: [
32
+ header && /*#__PURE__*/ _jsx("div", {
33
+ className: "pb-1.5 mb-1.5 border-b border-white/10 px-2 pt-1",
34
+ children: header
35
+ }),
36
+ optionsComponent || children,
37
+ footer && /*#__PURE__*/ _jsx("div", {
38
+ className: "pt-1.5 mt-1.5 border-t border-white/10 px-2 pb-1",
39
+ children: footer
40
+ })
41
+ ]
42
+ })
43
+ });
44
+ });
45
+ WaterGlassModal.displayName = 'WaterGlassModal';
46
+ export default WaterGlassModal;